Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # makefile
  2. # none of these vars are actually in use yet
  3. LOGO = 786747-DMG.jpeg
  4. TITLE = 5e SRD
  5. VER = $(shell date +%y.%m.%d)
  6. PANDOC = $(shell which pandoc 2>/dev/null || false)
  7. PDFTK = $(shell which pdftk 2>/dev/null || false)
  8. # if no pdftk, then use pdf-stapler
  9. ifeq "$(PDFTK)" ""
  10. PDFTK = pdf-stapler
  11. endif
  12. # on Slackware I use a statically compiled pandoc
  13. # this is not a solution to not having pandoc
  14. ifeq "$(PANDOC)" ""
  15. PANDOC = pandoc.static
  16. endif
  17. #build:
  18. # mkdir $@
  19. help:
  20. @echo "make html Generate book as HTML."
  21. @echo "make txt Generate book as plain text."
  22. @echo "make epub Generate book as an epub."
  23. @echo "make pdf Generate book as an PDF."
  24. @echo "make clean Remove temporary build files."
  25. @echo "make nuke Remove temporary build and release files."
  26. html:
  27. $(PANDOC) --from markdown \
  28. --to html5 \
  29. -o index.html \
  30. 5e_SRD.md
  31. pdf:
  32. $(PANDOC) --chapters --toc \
  33. 5e_SRD.md \
  34. -H chapter_break.tex \
  35. -V linkcolor:blue \
  36. -V geometry:a4paper \
  37. -V geometry:margin=2cm \
  38. --latex-engine=xelatex \
  39. -o 5e_SRD.pdf
  40. #--lua-filter=headers.lua \
  41. epub:
  42. $(PANDOC) --chapters \
  43. --toc 5e_SRD.md \
  44. -H chapter_break.tex \
  45. -V linkcolor:blue \
  46. --epub-stylesheet=epub.css \
  47. -o 5e_SRD.epub