]> pere.pagekite.me Git - text-free-culture-lessig.git/blob - Makefile
c67cd8fc4e2cf32a30e7c8d98658387a34e3bd37
[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 # HTML rule
21 XP = xsltproc \
22 --nonet \
23 --novalid \
24 --xinclude data/html.xsl
25
26 DBTOEPUB = dbtoepub
27
28 all: lint lint.nb epub pdf
29
30 freeculture.nb.po: freeculture.pot
31 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
32
33 freeculture.nb.xml: freeculture.nb.po freeculture.xml
34 po4a --translate-only freeculture.nb.xml po4a.cfg
35
36 pdf: freeculture.nb.pdf freeculture.pdf
37 epub: freeculture.nb.epub
38 html: freeculture.html freeculture.nb.html
39
40 %.pdf: %.xml
41 $(DBLATEX) $^ --param=lingua=nb
42
43 %.html: %.xml
44 xmlto html-nochunks $^
45
46 %.epub: %.xml
47 $(DBTOEPUB) $^
48
49 freeculture.xml:
50 GET $(url) | gunzip > freeculture.xml
51
52 freeculture.pot: freeculture.xml
53 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
54
55 stats: update-stats progress.png
56 update-stats:
57 ( \
58 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
59 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
60 ) | tee -a stats.txt
61 progress.png: stats.txt progress.gnuplot
62 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
63 gnuplot progress.gnuplot
64 rm stats.csv
65
66 lint: freeculture.xml
67 xmllint --nonet --noout --postvalid --xinclude freeculture.xml
68
69 lint.nb: freeculture.nb.xml
70 xmllint --nonet --noout --postvalid --xinclude freeculture.nb.xml