Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 ?= node
  8. NPM ?= $(NODE) $(shell which npm)
  9. BROWSERIFY ?= $(NODE) $(BIN)/browserify
  10. MOCHA ?= $(NODE) $(BIN)/mocha
  11. ZUUL ?= $(NODE) $(BIN)/zuul
  12. REPORTER ?= spec
  13. all: dist/plist.js dist/plist-build.js dist/plist-parse.js
  14. install: node_modules
  15. clean:
  16. @rm -rf node_modules dist
  17. dist:
  18. @mkdir -p $@
  19. dist/plist-build.js: node_modules lib/build.js dist
  20. @$(BROWSERIFY) \
  21. --standalone plist \
  22. lib/build.js > $@
  23. dist/plist-parse.js: node_modules lib/parse.js dist
  24. @$(BROWSERIFY) \
  25. --standalone plist \
  26. lib/parse.js > $@
  27. dist/plist.js: node_modules lib/*.js dist
  28. @$(BROWSERIFY) \
  29. --standalone plist \
  30. index.js > $@
  31. node_modules: package.json
  32. @NODE_ENV= $(NPM) install
  33. @touch node_modules
  34. test:
  35. @if [ "x$(BROWSER_NAME)" = "x" ]; then \
  36. $(MAKE) test-node; \
  37. else \
  38. $(MAKE) test-zuul; \
  39. fi
  40. test-node:
  41. @$(MOCHA) \
  42. --reporter $(REPORTER) \
  43. test/*.js
  44. test-zuul:
  45. @if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \
  46. $(ZUUL) \
  47. --ui mocha-bdd \
  48. --browser-name $(BROWSER_NAME) \
  49. --browser-version $(BROWSER_VERSION) \
  50. test/*.js; \
  51. else \
  52. $(ZUUL) \
  53. --ui mocha-bdd \
  54. --browser-name $(BROWSER_NAME) \
  55. --browser-version $(BROWSER_VERSION) \
  56. --browser-platform "$(BROWSER_PLATFORM)" \
  57. test/*.js; \
  58. fi
  59. .PHONY: all install clean test test-node test-zuul