summaryrefslogtreecommitdiff
path: root/Makefile
blob: 311a56a0248ab14e8aa11b24ac498fb99736d6e6 (plain)
  1. markdown-snippets := topbar.mdwn footer.mdwn
  2. hypertext-snippets = $(markdown-snippets:%.mdwn=%.html)
  3. markdown := $(filter-out $(markdown-snippets),$(wildcard *.mdwn))
  4. hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html))
  5. all: $(hypertext) style.css
  6. update: source all
  7. source: .git
  8. git pull
  9. $(hypertext-snippets): %.html: %.mdwn Makefile
  10. pandoc -f markdown -t html -o $@ $<
  11. sed -i -e '1i <div class=\"$*\">' -e '$$ a </div>' $@
  12. %.html %/index.html: %.mdwn $(hypertext-snippets) Makefile
  13. $(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@))
  14. pandoc -s -c style.css -B topbar.html -A footer.html -f markdown -t html -o $@ $<
  15. %.css : %.scss Makefile
  16. scss --compass --style compressed $< $@
  17. clean:
  18. find -type f -name '*.html' -delete
  19. find -type d -empty -delete
  20. rm -rf .sass-cache
  21. MAKEFLAGS += --jobs
  22. .NOTPARALLEL: source
  23. .PHONY: all update source clean
  24. .INTERMEDIATE: $(hypertext-snippets)