xref: /unit/pkg/npm/Makefile (revision 968:dd79860ee5b9)
1816Salexander.borisov@nginx.com#!/usr/bin/make
2816Salexander.borisov@nginx.com
3953Salexander.borisov@nginx.cominclude ../../version
4816Salexander.borisov@nginx.com
5953Salexander.borisov@nginx.comVERSION ?= $(NXT_VERSION)
6953Salexander.borisov@nginx.comVERNUM ?= $(NXT_VERNUM)
7816Salexander.borisov@nginx.comNPM ?= npm
8816Salexander.borisov@nginx.com
9816Salexander.borisov@nginx.comdefault:
10816Salexander.borisov@nginx.com	@echo "valid targets: all publish clean"
11816Salexander.borisov@nginx.com
12816Salexander.borisov@nginx.comcopy:
13816Salexander.borisov@nginx.com	cp -rp ../../src/nodejs/unit-http .
14878Salexander.borisov@nginx.com	echo '#define NXT_NODE_VERNUM ${VERNUM}' > unit-http/version.h
15816Salexander.borisov@nginx.com	mv unit-http/binding_pub.gyp unit-http/binding.gyp
16*968Svbart@nginx.com	sed -e 's/"version"\s*:.*/"version": "${VERSION}",/' \
17816Salexander.borisov@nginx.com		unit-http/package.json > unit-http/package.json.tmp
18816Salexander.borisov@nginx.com	mv unit-http/package.json.tmp unit-http/package.json
19816Salexander.borisov@nginx.com
20816Salexander.borisov@nginx.compublish: copy
21816Salexander.borisov@nginx.com	cd unit-http && $(NPM) publish
22816Salexander.borisov@nginx.com
23816Salexander.borisov@nginx.comall: copy
24816Salexander.borisov@nginx.com
25816Salexander.borisov@nginx.comclean:
26816Salexander.borisov@nginx.com	rm -rf unit-http
27816Salexander.borisov@nginx.com
28816Salexander.borisov@nginx.com.PHONY: default all copy publish clean
29