]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - Makefile
Yet one more (smallish!) set of erroneously split paragraphs merged
[text-madewithcc.git] / Makefile
index aa8a73ba7e64aafb5b1c012fec568481a54b551c..34418ba2f1285c1d2bdf5930d635ce08d7f1cd72 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,16 @@ VERSION=20170609-2
 PANDOCOPTS = --top-level-division=part -t docbook -f markdown+inline_notes
 PANDOCOPTS = -t docbook -f markdown+inline_notes
 
+LANGS = es nl nb
+
+all: pdf
+
+clean:
+       rm -f $(SOURCE).pdf $(SOURCE).xml $(SOURCE).md
+       for LANG in $(LANGS); do \
+           rm -f $(SOURCE).$$LANG.pdf $(SOURCE).$$LANG.xml $(SOURCE).$$LANG.md ;\
+        done
+
 $(SOURCE).md: $(SOURCE).odt fixup.rb
        TEMP=`tempfile -p mwcc` && \
        pandoc -f odt $(SOURCE).odt -t markdown > $$TEMP && \
@@ -25,20 +35,23 @@ po/mwcc.pot: $(SOURCE).md
        echo '# Authors: Paul Stacey and Sarah Hinchliff Pearson' >> $@ && \
        tail --lines=+5 $$TEMP >> $@ && \
        rm $$TEMP
-       for LANG in po/*/mwcc.po; do \
+       set -e; for LANG in po/*/mwcc.po; do \
            echo -n $$LANG\  ; \
            msgmerge $$LANG po/mwcc.pot -U ; \
        done
 
+$(SOURCE).es.md: $(SOURCE).md po/es/mwcc.po
+       po4a-translate -f text -m $(SOURCE).md -p po/es/mwcc.po -l $@ -l $@ -L utf8 -M utf8 -k 20
 
 %.xml: %.md
-       pandoc -o $@ $(PANDOCOPTS) MadewithCreativeCommonsmostup-to-dateversion.md
+       pandoc -s -o $@ $(PANDOCOPTS) $^
 
-pdf: MadewithCreativeCommonsmostup-to-dateversion.xml
-       dblatex -b xetex MadewithCreativeCommonsmostup-to-dateversion.xml
+pdf: $(SOURCE).pdf
+%.pdf: %.xml
+       dblatex -b xetex $^
 
 XMLLINTOPTS = --nonet --noout  --xinclude --postvalid
-lint: MadewithCreativeCommonsmostup-to-dateversion.xml
+lint: $(SOURCE).xml
        xmllint $(XMLLINTOPTS) $^
 
 .SUFFIXES: .xml .md