Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. BASEDIR=$(CURDIR)
  2. INPUTDIR=$(BASEDIR)
  3. OUTPUTDIR=$(BASEDIR)/output
  4. SSH_HOST=saravia
  5. SSH_PORT=51022
  6. SSH_USER=freedom
  7. SSH_TARGET_DIR=/home/saravia
  8. help:
  9. @echo ' Makefile for a c-xperto web-site '
  10. @echo ' '
  11. @echo ' Usage: '
  12. @echo ' make publish Upload to saravia... '
  13. @echo ' '
  14. clear:
  15. echo "" > $(OUTPUTDIR)/style.css
  16. echo "" > $(OUTPUTDIR)/script.js
  17. merge:
  18. for file in css/*.css ; do \
  19. cat "$$file" >> $(OUTPUTDIR)/style.css ; \
  20. done
  21. merge_js:
  22. for file in js/*.js ; do \
  23. cat "$$file" >> $(OUTPUTDIR)/script.js ; \
  24. done
  25. spare_lines:
  26. tr -d '\n' < $(OUTPUTDIR)/script.js > /tmp/script.js
  27. cat /tmp/script.js > $(OUTPUTDIR)/script.js
  28. spare_lines_js:
  29. tr -d '\n' < $(OUTPUTDIR)/style.css > /tmp/style.css
  30. cat /tmp/style.css > $(OUTPUTDIR)/style.css
  31. compile: clear merge merge_js spare_lines spare_lines_js
  32. publish: compile
  33. rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)/
  34. .PHONY: help clear merge spare_lines compile publish