Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. REPO = git@github.com:twitter/hogan.js.git
  2. BUILD := build
  3. VERSION = ${shell node -e 'var s = JSON.parse(require("fs").readFileSync("package.json").toString()).version; console.log(s.substring(0, s.indexOf("-")));'}
  4. #
  5. # Run command line tests
  6. #
  7. test:
  8. @ node test/index.js
  9. #
  10. # Run Mustache spec tests
  11. #
  12. spec:
  13. @ node test/spec.js
  14. #
  15. # Run benchmark
  16. #
  17. benchmark:
  18. @ node benchmark/console/index.js
  19. clean:
  20. @ rm -rf dist/*
  21. #
  22. # Make a new version of Hogan from the current dev version.
  23. #
  24. release: clean
  25. @ echo "Creating a new version of Hogan."
  26. @ mkdir -p dist/nodejs
  27. @ cp -R lib dist/nodejs/lib
  28. @ node tools/release.js
  29. @ mkdir -p web/builds/$(VERSION)
  30. @ cp dist/*.* web/builds/$(VERSION)/.
  31. #
  32. # Make the gh-pages website
  33. #
  34. # This target builds the hogan.js github website using hogan.js.
  35. #
  36. # cd into build/gh-pages to check in the new site.
  37. #
  38. GH_PAGES = $(BUILD)/gh-pages
  39. web: | pages
  40. @cp -R web/* $(GH_PAGES)
  41. @@ node tools/web_templates.js
  42. @echo
  43. @echo "Website built in $(GH_PAGES)."
  44. #
  45. # Checkout the gh-pages branch.
  46. #
  47. pages: | $(BUILD)
  48. @if [ ! -d "$(GH_PAGES)" ]; then \
  49. git clone -b gh-pages $(REPO) $(GH_PAGES); \
  50. rm -rf $(GH_PAGES)/*; \
  51. fi;
  52. @mkdir -p $(GH_PAGES)/images
  53. $(BUILD):
  54. mkdir -p $(BUILD)
  55. .PHONY: test spec benchmark web release