Makefile 825 B

1234567891011121314151617181920212223242526272829303132333435
  1. NO_COLOR=\x1b[0m
  2. OK_COLOR=\x1b[32;01m
  3. ERROR_COLOR=\x1b[31;01m
  4. WARN_COLOR=\x1b[33;01m
  5. OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)
  6. ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)
  7. RUN_STRING=$(WARN_COLOR)[RUN]$(NO_COLOR)
  8. ROOT = .
  9. CSS = '$(ROOT)/assets/css'
  10. JS = '$(ROOT)/assets/js'
  11. BUILD = '$(ROOT)/assets/build'
  12. all: clean create css js
  13. clean:
  14. rm -f -R $(BUILD)
  15. @echo "$(OK_STRING) Clean build"
  16. create: clean
  17. mkdir $(BUILD)
  18. @echo "$(OK_STRING) Create build"
  19. css: create
  20. @echo "$(RUN_STRING) Compiling CSS"
  21. awk 'FNR==1{print ""}1' $(CSS)/*.css > $(BUILD)/main.css
  22. csso $(BUILD)/main.css $(BUILD)/main.css
  23. @echo "$(OK_STRING) CSS compiled"
  24. js: create
  25. @echo "$(RUN_STRING) Compiling JS"
  26. awk 'FNR==1{print ""}1' $(JS)/*.js > $(BUILD)/main.js
  27. uglifyjs $(BUILD)/main.js -o $(BUILD)/main.js
  28. @echo "$(OK_STRING) JS compiled"