X-Git-Url: https://pere.pagekite.me/gitweb/text-destroy-surveillance.git/blobdiff_plain/38c6419aae8d5f2b5a4b62a5f0921b163622b30c..90b0234412ce6f56657549f0b5d8b967c4e9aee0:/Makefile diff --git a/Makefile b/Makefile index a822536..aba0ac6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SOURCE=how-to-destroy-surveillance-capitalism -GENERATED = $(SOURCE).xml $(SOURCE).pdf \ - $(SOURCE).nb.xml $(SOURCE).nb.pdf +GENERATED = $(SOURCE).xml $(SOURCE).pdf $(SOURCE).html $(SOURCE).epub \ + $(SOURCE).nb.xml $(SOURCE).nb.pdf $(SOURCE).nb.html $(SOURCE).nb.epub PANDOC_OPTS = \ -t docbook4 @@ -11,21 +11,21 @@ DBLATEX_OPTS = \ all: $(GENERATED) # Workaround for missing titles -complete-book.xml: $(SOURCE).xml Makefile book.xml +$(SOURCE).xml: $(SOURCE)-body.xml Makefile book.xml bookinfo.xml xmllint --nonet --xinclude --postvalid book.xml > $@.new && \ mv $@.new $@ -$(SOURCE).pdf: complete-book.xml Makefile - dblatex $(DBLATEX_OPTS) complete-book.xml -o $@ +$(SOURCE).pdf: $(SOURCE).xml Makefile pdf.xsl + dblatex $(DBLATEX_OPTS) $(SOURCE).xml -o $@ -$(SOURCE).xml: $(SOURCE).rst Makefile - pandoc -s -o $@ $(PANDOC_OPTS) $(SOURCE).rst +$(SOURCE)-body.xml: $(SOURCE)-body.rst Makefile + pandoc -s -o $@ $(PANDOC_OPTS) $(SOURCE)-body.rst sed -i \ -e 's%“%%g' \ -e 's%”%%g' $@ -po/$(SOURCE).pot: complete-book.xml - po4a-gettextize -f docbook -m complete-book.xml \ +po/$(SOURCE).pot: $(SOURCE).xml + po4a-gettextize -f docbook -m $(SOURCE).xml \ -M UTF-8 -L UTF-8 \ --package-name "How to Destroy Surveillance Capitalism" \ --copyright-holder "Cory Doctorow" \ @@ -34,19 +34,27 @@ po/$(SOURCE).pot: complete-book.xml po/$(SOURCE).%.po: po/$(SOURCE).pot po4a --no-translations --msgmerge-opt --no-location po4a.cfg -$(SOURCE).nb.xml: po/$(SOURCE).nb.po complete-book.xml +$(SOURCE).nb.xml: po/$(SOURCE).nb.po $(SOURCE).xml po4a --translate-only $(SOURCE).nb.xml po4a.cfg -$(SOURCE).nb.pdf: $(SOURCE).nb.xml Makefile +$(SOURCE).nb.pdf: $(SOURCE).nb.xml Makefile pdf.xsl dblatex $(DBLATEX_OPTS) $(SOURCE).nb.xml -o $@ +.xml.epub: + dbtoepub -s epub.xsl $^ -o $@ + +.xml.html: + xmlto -x docbook-utf8.xsl -m pdf.xsl html-nochunks $^ + XMLLINTOPTS = --nonet --noout --xinclude --postvalid lint: book.xml xmllint $(XMLLINTOPTS) $^ clean: - $(RM) *~ $(GENERATED) complete-book.xml + $(RM) *~ $(GENERATED) $(SOURCE).xml distclean: clean stats: for f in po/*.po; do printf "$$f "; msgfmt --output /dev/null --statistics $$f; done + +.SUFFIXES: .xml .html .pdf .epub