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