GNUmakefile 684 B

12345678910111213141516171819202122232425262728293031323334
  1. BIN = ./node_modules/.bin
  2. .PHONY: all
  3. all: lib
  4. lib: $(foreach s,$(wildcard src/*.coffee),$(patsubst src/%.coffee,lib/%.js,$s))
  5. lib-cov: clean-coverage lib
  6. $(BIN)/istanbul instrument --output lib-cov --no-compact --variable global.__coverage__ lib
  7. lib/%.js: src/%.coffee
  8. $(BIN)/coffee -cb -o $(@D) $<
  9. .PHONY: test
  10. test: lib
  11. $(BIN)/mocha
  12. .PHONY: coverage
  13. coverage: lib-cov
  14. COVER=1 $(BIN)/mocha --reporter mocha-istanbul
  15. @echo
  16. @echo Open html-report/index.html file in your browser
  17. .PHONY: watch
  18. watch:
  19. $(BIN)/coffee --watch --bare --output lib src/*.coffee
  20. .PHONY: clean
  21. clean: clean-coverage
  22. .PHONY: clean-coverage
  23. clean-coverage:
  24. -rm -rf lib-cov
  25. -rm -rf html-report