]> pere.pagekite.me Git - text-free-culture-lessig.git/blob - Makefile
Translate another.
[text-free-culture-lessig.git] / Makefile
1 #
2 # configuration here:
3 #
4
5 url = http://www.sslug.dk/~chlor/lessig/freeculture.sgml.2004-04-01.gz
6
7 # PDF rule
8 # Valid book options are a4paper, a5paper, b5paper, letterpaper,
9 # legalpaper, landscape, 11pt, 12pt, oneside, twocolumn, notitlepage,
10 # titlepage, openany, draft, fleqn, leqno
11 DBLATEX = dblatex \
12 -P latex.class.options=a5paper \
13 -T db2latex \
14 --backend=xetex \
15 --xsl-user=data/user_param.xsl \
16 --xsl-user=data/xetex_param.xsl \
17 -p data/pdf.xsl \
18 --param=lingua=nb
19
20 DBTOEPUB = dbtoepub
21
22 all: lint lint.nb epub pdf
23
24 freeculture.nb.po: freeculture.pot
25 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
26
27 freeculture.nb.xml: freeculture.nb.po freeculture.xml
28 po4a --translate-only freeculture.nb.xml po4a.cfg
29
30 pdf: freeculture.nb.pdf freeculture.pdf
31 epub: freeculture.nb.epub
32 html: freeculture.html freeculture.nb.html
33
34 %.pdf: %.xml
35 $(DBLATEX) $^ --param=lingua=nb
36
37 %.html: %.xml
38 xmlto html-nochunks $^
39
40 %.epub: %.xml
41 $(DBTOEPUB) $^
42
43 freeculture.xml:
44 GET $(url) | gunzip > freeculture.xml
45
46 freeculture.pot: freeculture.xml
47 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
48
49 stats: update-stats progress.png
50 update-stats:
51 ( \
52 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
53 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
54 ) | tee -a stats.txt
55 progress.png: stats.txt progress.gnuplot
56 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
57 gnuplot progress.gnuplot
58 rm stats.csv
59
60 lint: freeculture.xml
61 xmllint --nonet --noout --postvalid --xinclude freeculture.xml
62
63 lint.nb: freeculture.nb.xml
64 xmllint --nonet --noout --postvalid --xinclude freeculture.nb.xml