12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ISTANBUL = node_modules/.bin/istanbul
  2. UGLIFYJS = node_modules/.bin/uglifyjs
  3. XYZ = node_modules/.bin/xyz --message X.Y.Z --tag X.Y.Z --script scripts/prepublish
  4. SRC = base64.js
  5. MIN = $(patsubst %.js,%.min.js,$(SRC))
  6. .PHONY: all
  7. all: $(MIN)
  8. %.min.js: %.js
  9. $(UGLIFYJS) $< --compress --mangle > $@
  10. .PHONY: bytes
  11. bytes: base64.min.js
  12. gzip --best --stdout $< | wc -c | tr -d ' '
  13. .PHONY: clean
  14. clean:
  15. rm -f -- $(MIN)
  16. .PHONY: release-major release-minor release-patch
  17. release-major:
  18. $(XYZ) --increment major
  19. release-minor:
  20. $(XYZ) --increment minor
  21. release-patch:
  22. $(XYZ) --increment patch
  23. .PHONY: setup
  24. setup:
  25. npm install
  26. .PHONY: test
  27. test:
  28. $(ISTANBUL) cover node_modules/.bin/_mocha -- --compilers coffee:coffee-script/register