Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. TAPE = ./node_modules/.bin/tape
  2. JSSTYLE_FILES := $(shell find lib test -name "*.js")
  3. all $(TAPE):
  4. npm install
  5. .PHONY: clean
  6. clean:
  7. rm -rf examples/*.json examples/*.log
  8. .PHONY: distclean
  9. distclean: clean
  10. rm -rf node_modules
  11. .PHONY: test
  12. test: | $(TAPE)
  13. $(TAPE) test/*.test.js
  14. .PHONY: check-jsstyle
  15. check-jsstyle: $(JSSTYLE_FILES)
  16. ./tools/jsstyle -o indent=4,doxygen,unparenthesized-return=0,blank-after-start-comment=0,leading-right-paren-ok $(JSSTYLE_FILES)
  17. .PHONY: check
  18. check: check-jsstyle
  19. @echo "Check ok."
  20. # Ensure CHANGES.md and package.json have the same version.
  21. .PHONY: versioncheck
  22. versioncheck:
  23. @echo version is: $(shell cat package.json | json version)
  24. [[ `cat package.json | json version` == `grep '^## ' CHANGES.md | head -1 | awk '{print $$2}'` ]]
  25. .PHONY: cutarelease
  26. cutarelease: versioncheck
  27. [[ `git status | tail -n1` == "nothing to commit, working directory clean" ]]
  28. ./tools/cutarelease.py -p trace-event -f package.json
  29. .PHONY: git-hooks
  30. git-hooks:
  31. [[ -e .git/hooks/pre-commit ]] || ln -s ../../tools/pre-commit.sh .git/hooks/pre-commit