category-theory-for-program.../makefile

38 lines
964 B
Makefile
Raw Normal View History

2017-09-07 19:44:59 +02:00
title = category-theory-for-programmers
2017-09-05 16:02:17 +02:00
root = $(shell pwd)
src = $(root)/src
2017-09-06 02:14:05 +02:00
chapters = $(shell find $(src)/part-* -name '*.html' | sort -V)
2017-09-05 16:02:17 +02:00
2017-09-07 19:44:59 +02:00
all: $(title).epub $(title).pdf
$(title).pdf:
@ cd $(src)/init; \
pandoc \
$(src)/init/preface.html \
$(chapters) \
--smart \
--toc \
--number-section \
--latex-engine=xelatex \
2017-09-08 04:35:01 +02:00
--data-dir=$(root)/pandoc \
2017-09-07 19:44:59 +02:00
-H $(root)/pandoc/options.tex \
-o $(root)/$(title).pdf
$(title).epub:
@ cd $(src)/init; \
2017-09-06 02:14:05 +02:00
pandoc \
$(src)/init/preface.html \
$(chapters) \
--smart \
--toc \
--number-section \
--epub-stylesheet=$(root)/pandoc/style.css \
--epub-cover-image=$(root)/pandoc/cover.png \
--epub-embed-font='$(src)/fonts/*.woff' \
2017-09-05 16:02:17 +02:00
-o $(root)/$(title).epub
2017-09-08 04:35:01 +02:00
clean:
rm $(root)/$(title).{pdf,epub}