]> pere.pagekite.me Git - text-destroy-surveillance.git/blob - Makefile
c0d474192576f5150cfa3de53fd3128caa4be19d
[text-destroy-surveillance.git] / Makefile
1 SOURCE=how-to-destroy-surveillance-capitalism
2 GENERATED = $(SOURCE).xml $(SOURCE).pdf
3
4 PANDOC_OPTS = \
5 --top-level-division=chapter \
6 -t docbook4
7
8 DBLATEX_OPTS = \
9 -P page.width=6in \
10 -P page.height=9in \
11 -P page.margin.inner=0.8in \
12 -P page.margin.outer=0.55in \
13 -P page.margin.top=0.55in \
14 -P page.margin.bottom=0.55in \
15 -P ulink.show=1 \
16 -P ulink.footnotes=1 \
17 -P double.sided=1 \
18 -P doc.collab.show=0 \
19 -P latex.output.revhistory=0 \
20 -P draft.mode=yes -Pdraft.watermark=1
21
22 all: $(GENERATED)
23
24 # Workaround for missing titles
25 complete-book.xml: $(SOURCE).xml Makefile book.xml
26 xmllint --nonet --xinclude --postvalid book.xml > $@.new && \
27 mv $@.new $@
28
29 $(SOURCE).pdf: complete-book.xml Makefile
30 dblatex $(DBLATEX_OPTS) complete-book.xml -o $@
31
32 $(SOURCE).xml: $(SOURCE).rst Makefile
33 pandoc -s -o $@ $(PANDOC_OPTS) $(SOURCE).rst
34
35 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
36 lint: book.xml
37 xmllint $(XMLLINTOPTS) $^
38
39 clean:
40 $(RM) $(GENERATED) complete-book.xml