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.

36 lines
715 B

  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