annotate Makefile @ 725:83a687a996b2

Basically completed Docbook xml make environment
author Dongsheng Song <dongsheng.song@gmail.com>
date Thu, 12 Mar 2009 15:52:36 +0800
parents
children 0e3d8f66bbb7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
1 #
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
2 # Makefile for the hgbook, top-level
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
3 #
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
4
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
5 FORMATS=html html-single pdf
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
6
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
7 PO_LANGUAGES := zh
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
8 DBK_LANGUAGES := en
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
9 LANGUAGES := $(DBK_LANGUAGES) $(PO_LANGUAGES)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
10
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
11 UPDATEPO = PERLLIB=../tools/po4a/lib/ ../tools/po4a/po4a-updatepo -M UTF-8 \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
12 -f docbook -o doctype='docbook' -o includeexternal \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
13 -o nodefault='<programlisting> <screen>' \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
14 -o untranslated='<programlisting> <screen>'
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
15 TRANSLATE = PERLLIB=tools/po4a/lib/ tools/po4a/po4a-translate -M UTF-8 \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
16 -f docbook -o doctype='docbook' \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
17 -k 0
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
18
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
19 #rev_id = $(shell hg parents --template '{node|short} ({date|isodate})')
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
20 rev_id = $(shell hg parents --template '{node|short} ({date|shortdate})')
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
21
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
22 images := \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
23 en/images/feature-branches.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
24 en/images/filelog.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
25 en/images/metadata.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
26 en/images/mq-stack.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
27 en/images/revlog.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
28 en/images/snapshot.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
29 en/images/tour-history.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
30 en/images/tour-merge-conflict.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
31 en/images/tour-merge-merge.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
32 en/images/tour-merge-pull.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
33 en/images/tour-merge-sep-repos.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
34 en/images/undo-manual-merge.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
35 en/images/undo-manual.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
36 en/images/undo-non-tip.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
37 en/images/undo-simple.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
38 en/images/wdir-after-commit.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
39 en/images/wdir-branch.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
40 en/images/wdir-merge.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
41 en/images/wdir.png \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
42 en/images/wdir-pre-branch.png
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
43
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
44 help:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
45 @echo " make html [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
46 @echo " make html-single [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
47 @echo " make pdf [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
48 @echo " make validate [LINGUA=en|zh|...] # always before commit!"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
49 @echo " make tidypo [LINGUA=zh|...] # always before commit!"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
50 @echo " make updatepo [LINGUA=zh|...] # update po files."
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
51 @echo " make all [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
52 @echo " make stat # print statistics about po files."
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
53 @echo " make clean # Remove the build files."
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
54
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
55 clean:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
56 @rm -fr build po/*.mo
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
57
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
58 all:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
59 ifdef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
60 for f in $(FORMATS); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
61 $(MAKE) LINGUA=$(LINGUA) $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
62 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
63 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
64 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
65 for f in $(FORMATS); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
66 $(MAKE) LINGUA=$$l $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
67 done; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
68 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
69 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
70
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
71 stat:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
72 @( \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
73 LANG=C; export LANG; cd po; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
74 for f in *.po; do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
75 printf "%s\t" $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
76 msgfmt --statistics -c $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
77 done; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
78 )
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
79
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
80 tidypo:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
81 ifdef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
82 msgcat --sort-by-file --width=80 po/$(LINGUA).po > po/$(LINGUA).tmp && \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
83 mv po/$(LINGUA).tmp po/$(LINGUA).po;
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
84 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
85 for po in $(wildcard po/*.po); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
86 msgcat --sort-by-file --width=80 $$po > $$po.tmp && mv $$po.tmp $$po; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
87 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
88 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
89
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
90 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
91 updatepo:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
92 for l in $(PO_LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
93 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
94 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
95 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
96 updatepo:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
97 ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" ""
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
98 (cd po && $(UPDATEPO) -m ../en/00book.xml -p $(LINGUA).po)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
99 $(MAKE) tidypo LINGUA=$(LINGUA)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
100 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
101 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
102
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
103 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
104 validate:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
105 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
106 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
107 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
108 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
109 validate: build/$(LINGUA)/source/hgbook.xml
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
110 xmllint --nonet --noout --postvalid --xinclude $<
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
111
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
112 ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" ""
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
113 build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(images)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
114 mkdir -p build/$(LINGUA)/source
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
115 cp -r $(LINGUA)/* build/$(LINGUA)/source
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
116 xmllint --nonet --noent --xinclude --postvalid --output $@.tmp $(LINGUA)/00book.xml
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
117 cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
118 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
119 build/$(LINGUA)/source/hgbook.xml: $(wildcard en/*.xml) po/$(LINGUA).po $(images)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
120 mkdir -p build/$(LINGUA)/source
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
121 cp -r en/images build/$(LINGUA)/source
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
122 cp -r en/examples build/$(LINGUA)/source
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
123 cp en/book-shortcuts.xml build/$(LINGUA)/source
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
124 for f in en/*.xml; do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
125 if [ $$f != "en/book-shortcuts.xml" ]; then \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
126 $(TRANSLATE) -m $$f -p po/$(LINGUA).po -l build/$(LINGUA)/source/`basename $$f`; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
127 fi \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
128 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
129 xmllint --nonet --noent --xinclude --postvalid --output $@.tmp build/$(LINGUA)/source/00book.xml
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
130 cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
131 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
132
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
133 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
134
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
135 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
136 html:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
137 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
138 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
139 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
140 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
141 html: build/$(LINGUA)/html/index.html
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
142
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
143 build/$(LINGUA)/html/index.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html.xsl stylesheets/$(LINGUA)/html.xsl
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
144 mkdir -p build/$(LINGUA)/html/images
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
145 cp en/images/*.png build/$(LINGUA)/html/images
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
146 cp stylesheets/hgbook.css build/$(LINGUA)/html
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
147 xsltproc --output build/$(LINGUA)/html/ \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
148 stylesheets/$(LINGUA)/html.xsl build/$(LINGUA)/source/hgbook.xml
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
149 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
150
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
151 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
152 html-single:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
153 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
154 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
155 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
156 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
157 html-single: build/$(LINGUA)/html-single/hgbook.html
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
158
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
159 build/$(LINGUA)/html-single/hgbook.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html-single.xsl stylesheets/$(LINGUA)/html-single.xsl
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
160 mkdir -p build/$(LINGUA)/html-single/images
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
161 cp en/images/*.png build/$(LINGUA)/html-single/images
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
162 cp stylesheets/hgbook.css build/$(LINGUA)/html-single
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
163 xsltproc --output build/$(LINGUA)/html-single/hgbook.html \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
164 stylesheets/$(LINGUA)/html-single.xsl build/$(LINGUA)/source/hgbook.xml
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
165 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
166
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
167 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
168 pdf:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
169 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
170 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
171 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
172 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
173 pdf: build/$(LINGUA)/pdf/hgbook.pdf
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
174
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
175 build/$(LINGUA)/pdf/hgbook.pdf: build/$(LINGUA)/source/hgbook.xml stylesheets/fo.xsl stylesheets/$(LINGUA)/fo.xsl
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
176 mkdir -p build/$(LINGUA)/pdf
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
177 java -classpath tools/fop/lib/saxon65.jar:tools/fop/lib/saxon65-dbxsl.jar:tools/fop/lib/xml-commons-resolver-1.2.jar:tools/fop/conf \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
178 com.icl.saxon.StyleSheet \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
179 -x org.apache.xml.resolver.tools.ResolvingXMLReader \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
180 -y org.apache.xml.resolver.tools.ResolvingXMLReader \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
181 -r org.apache.xml.resolver.tools.CatalogResolver \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
182 -o build/$(LINGUA)/source/hgbook.fo \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
183 build/$(LINGUA)/source/hgbook.xml \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
184 stylesheets/$(LINGUA)/fo.xsl \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
185 fop1.extensions=1
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
186
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
187 (cd build/$(LINGUA)/source && ../../../tools/fop/fop.sh hgbook.fo ../pdf/hgbook.pdf)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
188 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
189
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
190 en/images/%.png: en/images/%.svg
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
191 inkscape -D -d 120 -e $@ $<
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
192
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
193 en/images/%.svg: en/images/%.dot
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
194 dot -Tsvg -o $@ $<