]> pere.pagekite.me Git - text-madewithcc.git/blob - Makefile
Makefile patch by Petter Reinholdtsenfor the PDF build process. Thanks!
[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 $(SOURCE).md: $(SOURCE).odt fixup.rb
13 TEMP=`tempfile -p mwcc` && \
14 pandoc -f odt $(SOURCE).odt -t markdown > $$TEMP && \
15 ruby fixup.rb $$TEMP $(SOURCE).md && \
16 rm $$TEMP
17
18 pot: po/mwcc.pot po/*/mwcc.po
19 po/mwcc.pot: $(SOURCE).md
20 TEMP=`tempfile -p mwcc` && \
21 po4a-gettextize -f text -m $(SOURCE).md -p $$TEMP -M utf-8 --package-name 'Made with Creative Commons' --package-version $(VERSION) && \
22 echo '# MADE WITH CREATIVE COMMONS' > $@ && \
23 echo '# Copyright (C) 2017 by Creative Commons.' >> $@ && \
24 echo '# This file is published under a Creative Commons Attribution-ShareAlike license (CC BY-SA), version 4.0' >> $@ && \
25 echo '# Authors: Paul Stacey and Sarah Hinchliff Pearson' >> $@ && \
26 tail --lines=+5 $$TEMP >> $@ && \
27 rm $$TEMP
28 set -e; for LANG in po/*/mwcc.po; do \
29 echo -n $$LANG\ ; \
30 msgmerge $$LANG po/mwcc.pot -U ; \
31 done
32
33 $(SOURCE).es.md: $(SOURCE).md po/es/mwcc.po
34 po4a-translate -f text -m $(SOURCE).md -p po/es/mwcc.po -l $@ -l $@ -L utf8 -M utf8 -k 20
35
36 %.xml: %.md
37 pandoc -s -o $@ $(PANDOCOPTS) $^
38
39 pdf: $(SOURCE).pdf
40 %.pdf: %.xml
41 dblatex -b xetex $^
42
43 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
44 lint: $(SOURCE).xml
45 xmllint $(XMLLINTOPTS) $^
46
47 .SUFFIXES: .xml .md