Makefile 715 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # get Makefile directory name: http://stackoverflow.com/a/5982798/376773
  2. THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
  3. THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
  4. # BIN directory
  5. BIN := $(THIS_DIR)/node_modules/.bin
  6. # applications
  7. NODE ?= $(shell which node)
  8. NPM ?= $(NODE) $(shell which npm)
  9. BROWSERIFY ?= $(NODE) $(BIN)/browserify
  10. all: dist/debug.js
  11. install: node_modules
  12. clean:
  13. @rm -rf dist
  14. dist:
  15. @mkdir -p $@
  16. dist/debug.js: node_modules browser.js debug.js dist
  17. @$(BROWSERIFY) \
  18. --standalone debug \
  19. . > $@
  20. distclean: clean
  21. @rm -rf node_modules
  22. node_modules: package.json
  23. @NODE_ENV= $(NPM) install
  24. @touch node_modules
  25. .PHONY: all install clean distclean