X-Git-Url: https://pere.pagekite.me/gitweb/text-madewithcc.git/blobdiff_plain/2265bef211617642ad3b771c1c873d4e52d0c164..1216a86be9af7078bca98ff452b931ca6e7ff294:/Makefile diff --git a/Makefile b/Makefile index 7cea8fd..2ba21a3 100644 --- a/Makefile +++ b/Makefile @@ -20,14 +20,23 @@ PANDOC_OPTS = \ LANGS := $(shell ls po/*/mwcc.po|cut -d/ -f2) +DESTDIR = + +docdir = /usr/share/doc/madewithcc + +install = install + all: pdf epub +install: + $(install) *.pdf *.epub $(DESTDIR)/$(docdir) + distclean: clean rm -f $(SOURCE).md +clean: for LANG in $(LANGS); do \ rm -f $(SOURCE).$$LANG.md ;\ done -clean: for EXT in aux cb cb2 glo idx lof log tex toc xml pdf epub; do \ rm -f $(SOURCE).$$EXT ;\ for LANG in $(LANGS); do \ @@ -80,13 +89,20 @@ $(SOURCE).xml: $(SOURCE).md fixup-docbook.rb pandoc -s -o $$TEMP $(PANDOC_OPTS) $(SOURCE).md && \ ruby fixup-docbook.rb $$TEMP $@ && \ rm $$TEMP + xmllint --format $@ > $@.new && mv $@.new $@ pdf: $(SOURCE).pdf + for LANG in $(LANGS); do \ + $(MAKE) $(SOURCE).$$LANG.pdf ; \ + done %.pdf: %.tex pdflatex $^ pdflatex $^ epub: $(SOURCE).epub + for LANG in $(LANGS); do \ + $(MAKE) $(SOURCE).$$LANG.epub ; \ + done %.epub: %.xml dbtoepub $^ @@ -95,12 +111,7 @@ DBLATEX_OPTS = -T simple -t tex -b xetex -p extra/pdf.xsl # handled by LaTeX/dblatex, see . %.tex: %.xml dblatex $(DBLATEX_OPTS) $^ - perl -p -i -e 's/\\caption\\end/\\caption{} \\end/; \ - s/ / /g; \ - s/\\chapter\{(Colophon|Dedication)\}/\\chapter*{}/; \ - s/\\chapter\{(Foreword|Prefacio|Forord|Introduction|Introducción|Introduksjon)\}/\\chapter*{$$1} \\addcontentsline{toc}{chapter}{$$1}/; \ - s/\\section\{(Notes|Notas)\}/\\section*{$$1}/; \ - s/(Web links?|Vínculos Web)/\\section*{$$1}/;' $@ + perl -p -i -e 's/ / /g' $@ XMLLINTOPTS = --nonet --noout --xinclude --postvalid lint: $(SOURCE).xml @@ -112,7 +123,7 @@ lint-nb: $(SOURCE).nb.xml check-urls: retval=0; for u in $$(perl -n -e'// && print "$$1\n"' MadewithCreativeCommonsmostup-to-dateversion.xml | sort -u); do \ - HEAD -H "User-Agent: Docbook XML URL checker" "$$u" > /dev/null || echo "error fetching $$u"; retval=1; \ + GET -H "User-Agent: Docbook XML URL checker" "$$u" > /dev/null || echo "error fetching $$u"; retval=1; \ done; exit $$retval # Experimental build rule to test Docbook XSL + FOP processor