]> pere.pagekite.me Git - text-free-culture-lessig.git/blob - Makefile
Merge fixes from MartinBorg.
[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: 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 $(XP) $^ && mv index.html $@
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:
56 ( \
57 date +"%Y-%m-%dT%H%M" ; \
58 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
59 ) | tee -a stats.txt
60
61 lint:
62 xmllint --nonet --noout --postvalid --xinclude freeculture.xml