]> pere.pagekite.me Git - text-destroy-surveillance.git/blob - Makefile
Regenerated.
[text-destroy-surveillance.git] / Makefile
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
4
5 PANDOC_OPTS = \
6 -t docbook4
7
8 DBLATEX_OPTS = \
9 -p pdf.xsl
10
11 all: $(GENERATED)
12
13 # Workaround for missing titles
14 $(SOURCE).xml: $(SOURCE)-body.xml Makefile book.xml bookinfo.xml
15 xmllint --nonet --xinclude --postvalid book.xml > $@.new && \
16 mv $@.new $@
17
18 $(SOURCE).pdf: $(SOURCE).xml Makefile pdf.xsl
19 dblatex $(DBLATEX_OPTS) $(SOURCE).xml -o $@
20
21 $(SOURCE)-body.xml: $(SOURCE)-body.rst Makefile
22 pandoc -s -o $@ $(PANDOC_OPTS) $(SOURCE)-body.rst
23 sed -i \
24 -e 's%“%<quote>%g' \
25 -e 's%”%</quote>%g' $@
26
27 po/$(SOURCE).pot: $(SOURCE).xml
28 po4a-gettextize -f docbook -m $(SOURCE).xml \
29 -M UTF-8 -L UTF-8 \
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
36
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 $@
41
42 .xml.epub:
43 dbtoepub -s epub.xsl $^ -o $@
44
45 .xml.html:
46 xmlto -x docbook-utf8.xsl -m pdf.xsl html-nochunks $^
47
48 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
49 lint: book.xml
50 xmllint $(XMLLINTOPTS) $^
51
52 clean:
53 $(RM) *~ $(GENERATED) $(SOURCE).xml
54
55 distclean: clean
56
57 stats:
58 for f in po/*.po; do printf "$$f "; msgfmt --output /dev/null --statistics $$f; done
59
60 .SUFFIXES: .xml .html .pdf .epub