#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ --with nodejs

# use upstream
_prelude.js: prelude.js
	node bin/prepublish.js

override_dh_auto_build: _prelude.js

override_dh_fixperms:
	dh_fixperms
	chmod a+x debian/node-browser-pack/usr/share/nodejs/browser-pack/bin/cmd.js

example/output.js: _prelude.js example/input.json
	./bin/cmd.js < example/input.json > example/output.js

example/sourcemap/output.js: _prelude.js example/sourcemap/input.json
	./bin/cmd.js < example/sourcemap/input.json > example/sourcemap/output.js


override_dh_installexamples: example/output.js example/sourcemap/output.js
	dh_installexamples


override_dh_auto_clean:
	dh_auto_clean
	rm -f _prelude.js
	rm -f example/output.js
	rm -f example/sourcemap/output.js
