summaryrefslogtreecommitdiff
path: root/Makefile
blob: 87a0d32ff3a5dee4ad1b650a6540762e037bc28e (plain)
  1. markdown-snippets := topbar.mdwn footer.mdwn
  2. hypertext-snippets = $(markdown-snippets:%.mdwn=%.html)
  3. markdown := $(filter-out $(markdown-snippets),$(wildcard *.mdwn */*.mdwn */*/*.mdwn))
  4. hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html))
  5. graph := $(wildcard *.dot */*.dot */*/*.dot)
  6. vectorimage-graph := $(graph:%.dot=%.svg)
  7. compass_plugins = h5bp
  8. all: $(hypertext) $(vectorimage-graph) style.css
  9. update: .git
  10. git pull
  11. $(MAKE) all
  12. $(hypertext-snippets): %.html: %.mdwn Makefile
  13. pandoc -f markdown -t html -o $@ $<
  14. sed -i -e '1i <div class=\"$*\">' -e '$$ a </div>' $@
  15. $(vectorimage-graph): %.svg: %.dot Makefile
  16. dot -Tsvg -o$@ $<
  17. %.html %/index.html: %.mdwn $(hypertext-snippets) Makefile
  18. $(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@))
  19. pandoc -s -c $(shell realpath --relative-to=$(dir $@) style.css) -B topbar.html -A footer.html -f markdown -t html -o $@ $<
  20. %.css : %.scss Makefile
  21. sassc --load-path /usr/share/sass/stylesheets $(compass_plugins:%=--load-path /usr/share/compass/frameworks/%/stylesheets) --style compressed $< $@
  22. clean:
  23. rm -f $(vectorimage-graph)
  24. find -type f -name '*.html' -delete
  25. find -type d -empty -delete
  26. rm -f style.css style.css.map
  27. rm -rf .sass-cache
  28. MAKEFLAGS += --jobs
  29. .NOTPARALLEL: source
  30. .PHONY: all update clean