]> pere.pagekite.me Git - text-madewithcc.git/blob - Makefile
Merge translations and Spanish administrativia
[text-madewithcc.git] / Makefile
1 SOURCE=MadewithCreativeCommonsmostup-to-dateversion
2
3 # Versioning: I'm using the date on which I got the source document
4 # (2017-06-09), plus an incrementing local part, that *should*
5 # increase every time the generated Markdown is modified.
6 VERSION=20170609-2
7
8 # --top-level-diversion is not available in pandoc in Jessie
9 PANDOCOPTS = --top-level-division=part -t docbook -f markdown+inline_notes
10 PANDOCOPTS = -t docbook -f markdown+inline_notes
11
12 LANGS = es nl nb
13
14 all: pdf
15
16 clean:
17 rm -f $(SOURCE).pdf $(SOURCE).xml $(SOURCE).md
18 for LANG in $(LANGS); do \
19 rm -f $(SOURCE).$$LANG.pdf $(SOURCE).$$LANG.xml $(SOURCE).$$LANG.md ;\
20 done
21
22 $(SOURCE).md: $(SOURCE).odt fixup.rb
23 TEMP=`tempfile -p mwcc` && \
24 pandoc -f odt $(SOURCE).odt -t markdown > $$TEMP && \
25 ruby fixup.rb $$TEMP $(SOURCE).md && \
26 rm $$TEMP
27
28 pot: po/mwcc.pot po/*/mwcc.po
29 po/mwcc.pot: $(SOURCE).md
30 TEMP=`tempfile -p mwcc` && \
31 po4a-gettextize -f text -m $(SOURCE).md -p $$TEMP -M utf-8 --package-name 'Made with Creative Commons' --package-version $(VERSION) && \
32 echo '# MADE WITH CREATIVE COMMONS' > $@ && \
33 echo '# Copyright (C) 2017 by Creative Commons.' >> $@ && \
34 echo '# This file is published under a Creative Commons Attribution-ShareAlike license (CC BY-SA), version 4.0' >> $@ && \
35 echo '# Authors: Paul Stacey and Sarah Hinchliff Pearson' >> $@ && \
36 tail --lines=+5 $$TEMP >> $@ && \
37 rm $$TEMP
38 set -e; for LANG in po/*/mwcc.po; do \
39 echo -n $$LANG\ ; \
40 msgmerge $$LANG po/mwcc.pot -U ; \
41 done
42
43 $(SOURCE).es.md: $(SOURCE).md po/es/mwcc.po
44 po4a-translate -f text -m $(SOURCE).md -p po/es/mwcc.po -l $@ -l $@ -L utf8 -M utf8 -k 20
45
46 %.xml: %.md
47 pandoc -s -o $@ $(PANDOCOPTS) $^
48
49 pdf: $(SOURCE).pdf
50 %.pdf: %.xml
51 dblatex -b xetex $^
52
53 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
54 lint: $(SOURCE).xml
55 xmllint $(XMLLINTOPTS) $^
56
57 .SUFFIXES: .xml .md