| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
%: |
| 8 |
dh $@ --with nodejs |
| 9 |
|
| 10 |
debian/testdir/examples: |
| 11 |
test -d debian/testdir || mkdir -p debian/testdir |
| 12 |
cp -rf examples debian/testdir |
| 13 |
|
| 14 |
testexamples: debian/testdir/examples node_modules/nan |
| 15 |
V=1 node-gyp rebuild --directory debian/testdir/examples/async_pi_estimate/ |
| 16 |
node debian/testdir/examples/async_pi_estimate/addon.js |
| 17 |
|
| 18 |
node_modules/nan: |
| 19 |
test -d node_modules || mkdir node_modules |
| 20 |
ln -s .. node_modules/nan |
| 21 |
|
| 22 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) |
| 23 |
override_dh_auto_test: testexamples |
| 24 |
V=1 node-gyp rebuild --directory test |
| 25 |
tap --disable-coverage -R tap --node-arg=--expose-gc test/js/*-test.js |
| 26 |
else: |
| 27 |
override_dh_auto_test: |
| 28 |
endif |
| 29 |
|
| 30 |
override_dh_auto_clean: |
| 31 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) |
| 32 |
-node-gyp clean |
| 33 |
endif |
| 34 |
dh_auto_clean |
| 35 |
rm -rf debian/testdir |
| 36 |
rm -rf node_modules |
| 37 |
|
| 38 |
.PHONY=testexamples |
| 39 |
|