Files
nginx-unit/pkg/npm/Makefile
Alexander Borisov 608e09e9de Improvement and unification of version processing in build scripts.
This also eliminates expressions that incompatible with BSD make, thus fixing
installation of Node.js module on FreeBSD (broken by dace60fc4926).
2019-02-22 16:31:44 +03:00

29 lines
603 B
Makefile

#!/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}.0",/' \
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