assets.makefile 849 B

12345678910111213141516171819202122232425262728
  1. # .assets.makefile:
  2. # curl -fsSL -o $@ https://raw.githubusercontent.com/vladimirok5959/assets/main/assets.makefile
  3. # include .assets.makefile
  4. .PHONY: assets
  5. CHECK_YUI_COMPRESSOR := $(shell command -v yui-compressor 2> /dev/null)
  6. CURRENT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
  7. FILES_CSS := $(shell find ${CURRENT_DIR} -type f -name '*.dev.css')
  8. FILES_JS := $(shell find ${CURRENT_DIR} -type f -name '*.dev.js')
  9. --check-yui-compressor:
  10. ifndef CHECK_YUI_COMPRESSOR
  11. # sudo apt-get install yui-compressor
  12. $(error "yui-compressor is not installed")
  13. endif
  14. --assets-css: --check-yui-compressor
  15. @for file in ${FILES_CSS}; do \
  16. ${CURRENT_DIR}/assets.sh $${file}; \
  17. done
  18. --assets-js: --check-yui-compressor
  19. @for file in ${FILES_JS}; do \
  20. ${CURRENT_DIR}/assets.sh $${file}; \
  21. done
  22. assets: --assets-css --assets-js