]> pere.pagekite.me Git - text-madewithcc.git/blob - Makefile
Merge branch 'weblate'
[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 for LANG in po/*/mwcc.po; do \
29 echo -n $$LANG\ ; \
30 msgmerge $$LANG po/mwcc.pot -U ; \
31 done
32
33
34 %.xml: %.md
35 pandoc -o $@ $(PANDOCOPTS) MadewithCreativeCommonsmostup-to-dateversion.md
36
37 pdf: MadewithCreativeCommonsmostup-to-dateversion.xml
38 dblatex -b xetex MadewithCreativeCommonsmostup-to-dateversion.xml
39
40 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
41 lint: MadewithCreativeCommonsmostup-to-dateversion.xml
42 xmllint $(XMLLINTOPTS) $^
43
44 .SUFFIXES: .xml .md