You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
678 B

7 years ago
  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 node_modules dist
  14. dist:
  15. @mkdir -p $@
  16. dist/debug.js: node_modules browser.js debug.js dist
  17. @$(BROWSERIFY) \
  18. --standalone debug \
  19. . > $@
  20. node_modules: package.json
  21. @NODE_ENV= $(NPM) install
  22. @touch node_modules
  23. .PHONY: all install clean