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