summaryrefslogtreecommitdiff
path: root/Makefile
blob: 2ba1f46fa76064b28f5666f547f568c78ff859bb (plain)
  1. htmlpages = index.html
  2. htmlheader = templates/header.html
  3. htmlfooter = templates/footer.html
  4. cssfiles := css/main.css css/print.css
  5. sass_includedir = /usr/share/compass/frameworks/toolkit/stylesheets
  6. all: $(htmlpages)
  7. $(htmlpages): %.html : %.md $(htmlheader) $(htmlfooter) $(cssfiles)
  8. cat $(htmlheader) > $@
  9. echo "<div id="book">" >> $@
  10. echo "<div id="page1" class="page"><div class="inner">" >> $@
  11. cmark $< >> $@
  12. perl -p0i -e '$$i or $$i++; s!(<hr\s*/?>\s*){2}(?{$$i++})!</div></div>\n\n<div id="page$$i" class="page"><div class="inner">!g' $@
  13. echo "</div></div>" >> $@
  14. cat $(htmlfooter) >> $@
  15. $(cssfiles): css/%.css : css/%.scss $(sass_includedir)
  16. sassc -I $(sass_includedir) $< $@
  17. clean:
  18. rm -f $(cssfiles) $(htmlpages)
  19. .PHONY: clean