forked from tamarin-prover/manual
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (38 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PANDOC = pandoc
IFORMAT = markdown
FLAGS = --standalone --toc --toc-depth=2 --mathjax=$(MATHJAX)
STYLE = css/style.css
ifdef MATHJAX_LOCAL
MATHJAX = ${MATHJAX_LOCAL}
else
MATHJAX ?= "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
endif
TEMPLATE_HTML = templates/template.html
TEMPLATE_TEX = templates/template.latex
SRC = $(sort $(wildcard src/*.md))
OBJ = $(subst .md,.html,$(subst src,book,$(SRC)))
TMP = $(subst src,tmp,$(SRC))
all: $(OBJ)
tmp/%.md: src/%.md ./filter.py
./filter.py $< $@
book/%.html: tmp/%.md $(TEMPLATE_HTML) latex_macros
$(PANDOC) -c $(STYLE) \
--template $(TEMPLATE_HTML) -s -f $(IFORMAT) \
--bibliography=src/manual.bib \
-t html $(FLAGS) -o $@ $<
pdf: $(TMP) $(TEMPLATE_LATEX) latex_macros
sed 's,[0-9]*_.*.html#,#,' < $(TMP) > tex/all.md
echo "\n# References\n\n" >> tex/all.md
$(PANDOC) -f $(IFORMAT) \
--template $(TEMPLATE_TEX) --latex-engine=xelatex $(FLAGS) \
--bibliography=src/manual.bib \
-o tex/tamarin-manual.tex tex/all.md
make -C tex
simple: $(TMP) $(TEMPLATE_LATEX) latex_macros
$(PANDOC) -f $(IFORMAT) \
--template $(TEMPLATE_TEX) --latex-engine=xelatex $(FLAGS) \
--bibliography=src/manual.bib \
-o tex/tamarin-manual.tex $(TMP)
make -C tex
clean:
-rm -f book/*.html tex/*.pdf tmp/*.md