xref: /unit/pkg/npm/Makefile (revision 816:e92e58984512)
1#!/usr/bin/make
2
3DEFAULT_VERSION := $(shell grep 'define NXT_VERSION' ../../src/nxt_main.h \
4			| sed -e 's/^.*"\(.*\)".*/\1/')
5
6VERSION ?= $(DEFAULT_VERSION)
7NPM ?= npm
8
9default:
10	@echo "valid targets: all publish clean"
11
12copy:
13	cp -rp ../../src/nodejs/unit-http .
14	mv unit-http/binding_pub.gyp unit-http/binding.gyp
15	sed -e 's/"version"\s*:.*/"version": "${VERSION}.0",/' \
16		unit-http/package.json > unit-http/package.json.tmp
17	mv unit-http/package.json.tmp unit-http/package.json
18
19publish: copy
20	cd unit-http && $(NPM) publish
21
22all: copy
23
24clean:
25	rm -rf unit-http
26
27.PHONY: default all copy publish clean
28