1 SOURCE=how-to-destroy-surveillance-capitalism
2 GENERATED = $(SOURCE).xml $(SOURCE).pdf $(SOURCE).html $(SOURCE).epub \
3 $(SOURCE).nb.xml $(SOURCE).nb.pdf $(SOURCE).nb.html $(SOURCE).nb.epub
13 # Workaround for missing titles
14 $(SOURCE).xml: $(SOURCE)-body.xml Makefile book.xml bookinfo.xml
15 xmllint --nonet --xinclude --postvalid book.xml > $@.new && \
18 $(SOURCE).pdf: $(SOURCE).xml Makefile pdf.xsl
19 dblatex $(DBLATEX_OPTS) $(SOURCE).xml -o $@
21 $(SOURCE)-body.xml: $(SOURCE)-body.rst Makefile
22 pandoc -s -o $@ $(PANDOC_OPTS) $(SOURCE)-body.rst
25 -e 's%”%</quote>%g' $@
27 po/$(SOURCE).pot: $(SOURCE).xml
28 po4a-gettextize -f docbook -m $(SOURCE).xml \
30 --package-name "How to Destroy Surveillance Capitalism" \
31 --copyright-holder "Cory Doctorow" \
32 --package-version "n/a" \
33 | sed 's/CHARSET/UTF-8/' > $@.new && mv $@.new $@
34 po/$(SOURCE).%.po: po/$(SOURCE).pot
35 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
37 $(SOURCE).nb.xml: po/$(SOURCE).nb.po $(SOURCE).xml
38 po4a --translate-only $(SOURCE).nb.xml po4a.cfg
39 $(SOURCE).nb.pdf: $(SOURCE).nb.xml Makefile pdf.xsl
40 dblatex $(DBLATEX_OPTS) $(SOURCE).nb.xml -o $@
43 dbtoepub -s epub.xsl $^ -o $@
46 xmlto -x docbook-utf8.xsl -m pdf.xsl html-nochunks $^
48 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
50 xmllint $(XMLLINTOPTS) $^
53 $(RM) *~ $(GENERATED) $(SOURCE).xml
58 for f in po/*.po; do printf "$$f "; msgfmt --output /dev/null --statistics $$f; done
60 .SUFFIXES: .xml .html .pdf .epub