summaryrefslogblamecommitdiffhomepage
path: root/pkg/npm/Makefile
blob: ef8ef7b5564519ea329241691da1ee35660513a9 (plain) (tree)
1
2
3
4
5
6

               
                     
 

                         






                                                
                                                                      
                                                          
                                                              











                                                                   
#!/usr/bin/make

include ../../version

VERSION ?= $(NXT_VERSION)
VERNUM ?= $(NXT_VERNUM)
NPM ?= npm

default:
	@echo "valid targets: all publish clean"

copy:
	cp -rp ../../src/nodejs/unit-http .
	echo '#define NXT_NODE_VERNUM ${VERNUM}' > unit-http/version.h
	mv unit-http/binding_pub.gyp unit-http/binding.gyp
	sed -e 's/"version"\s*:.*/"version": "${VERSION}",/' \
		unit-http/package.json > unit-http/package.json.tmp
	mv unit-http/package.json.tmp unit-http/package.json

publish: copy
	cd unit-http && $(NPM) publish

all: copy

clean:
	rm -rf unit-http

.PHONY: default all copy publish clean