annotate Makefile @ 756:1e020cb7d417

Remove tools
author Dongsheng Song <songdongsheng@live.cn>
date Mon, 30 Mar 2009 21:36:31 +0800
parents 1c13ed2130a7
children 8d130de70ebe
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 #
756
1e020cb7d417 Remove tools
Dongsheng Song <songdongsheng@live.cn>
parents: 753
diff changeset
4 include Makefile.vars
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
5
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
6 FORMATS=html html-single pdf
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
7
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
8 PO_LANGUAGES := zh
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
9 DBK_LANGUAGES := en
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
10 LANGUAGES := $(DBK_LANGUAGES) $(PO_LANGUAGES)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
11
756
1e020cb7d417 Remove tools
Dongsheng Song <songdongsheng@live.cn>
parents: 753
diff changeset
12 UPDATEPO = PERLLIB=$(PO4A_LIB) $(PO4A_HOME)/po4a-updatepo -M UTF-8 \
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
13 -f docbook -o doctype='docbook' -o includeexternal \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
14 -o nodefault='<programlisting> <screen>' \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
15 -o untranslated='<programlisting> <screen>'
756
1e020cb7d417 Remove tools
Dongsheng Song <songdongsheng@live.cn>
parents: 753
diff changeset
16 TRANSLATE = PERLLIB=$(PO4A_LIB) $(PO4A_HOME)/po4a-translate -M UTF-8 \
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
17 -f docbook -o doctype='docbook' \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
18 -k 0
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
19
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|isodate})')
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
21 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
22
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
23 images := \
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
24 en/figs/feature-branches.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
25 en/figs/filelog.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
26 en/figs/metadata.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
27 en/figs/mq-stack.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
28 en/figs/revlog.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
29 en/figs/snapshot.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
30 en/figs/tour-history.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
31 en/figs/tour-merge-conflict.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
32 en/figs/tour-merge-merge.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
33 en/figs/tour-merge-pull.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
34 en/figs/tour-merge-sep-repos.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
35 en/figs/undo-manual-merge.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
36 en/figs/undo-manual.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
37 en/figs/undo-non-tip.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
38 en/figs/undo-simple.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
39 en/figs/wdir-after-commit.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
40 en/figs/wdir-branch.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
41 en/figs/wdir-merge.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
42 en/figs/wdir.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
43 en/figs/wdir-pre-branch.png
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
44
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
45 help:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
46 @echo " make html [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
47 @echo " make html-single [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
48 @echo " make pdf [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
49 @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
50 @echo " make tidypo [LINGUA=zh|...] # always before commit!"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
51 @echo " make updatepo [LINGUA=zh|...] # update po files."
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
52 @echo " make all [LINGUA=en|zh|...]"
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
53 @echo " make stat # print statistics about po files."
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
54 @echo " make clean # Remove the build files."
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
55
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
56 clean:
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
57 @rm -fr build po/*.mo hello en/hello en/html en/.validated-00book.xml en/examples/.run en/examples/results \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
58 stylesheets/system-xsl en/figs/*-tmp.svg \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
59 en/figs/feature-branches.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
60 en/figs/filelog.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
61 en/figs/feature-branches.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
62 en/figs/filelog.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
63 en/figs/metadata.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
64 en/figs/mq-stack.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
65 en/figs/revlog.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
66 en/figs/snapshot.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
67 en/figs/tour-history.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
68 en/figs/tour-merge-conflict.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
69 en/figs/tour-merge-merge.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
70 en/figs/tour-merge-pull.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
71 en/figs/tour-merge-sep-repos.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
72 en/figs/undo-manual-merge.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
73 en/figs/undo-manual.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
74 en/figs/undo-non-tip.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
75 en/figs/undo-simple.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
76 en/figs/wdir-after-commit.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
77 en/figs/wdir-branch.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
78 en/figs/wdir-merge.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
79 en/figs/wdir-pre-branch.png \
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
80 en/figs/wdir.png
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
81
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
82 all:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
83 ifdef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
84 for f in $(FORMATS); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
85 $(MAKE) LINGUA=$(LINGUA) $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
86 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
87 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
88 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
89 for f in $(FORMATS); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
90 $(MAKE) LINGUA=$$l $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
91 done; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
92 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
93 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
94
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
95 stat:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
96 @( \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
97 LANG=C; export LANG; cd po; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
98 for f in *.po; do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
99 printf "%s\t" $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
100 msgfmt --statistics -c $$f; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
101 done; \
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
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
104 tidypo:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
105 ifdef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
106 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
107 mv po/$(LINGUA).tmp po/$(LINGUA).po;
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 for po in $(wildcard po/*.po); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
110 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
111 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
112 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
113
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
114 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
115 updatepo:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
116 for l in $(PO_LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
117 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
118 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
119 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
120 updatepo:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
121 ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" ""
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
122 (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
123 $(MAKE) tidypo LINGUA=$(LINGUA)
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
124 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
125 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
126
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
127 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
128 validate:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
129 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
130 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
131 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
132 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
133 validate: build/$(LINGUA)/source/hgbook.xml
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
134 xmllint --nonet --noout --postvalid --xinclude $<
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
135
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
136 ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" ""
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
137 $(LINGUA)/examples/.run:
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
138 (cd $(LINGUA)/examples; ./run-example -v -a)
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
139
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
140 build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(images) $(LINGUA)/examples/.run $(images)
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
141 mkdir -p build/$(LINGUA)/source/figs
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
142 cp $(LINGUA)/figs/*.png build/$(LINGUA)/source/figs
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
143 (cd $(LINGUA); xmllint --nonet --noent --xinclude --postvalid --output ../$@.tmp 00book.xml)
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
144 cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
145 else
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
146 en/examples/.run:
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
147 (cd en/examples; ./run-example -v -a)
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
148
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
149 build/en/source/hgbook.xml:
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
150 ${MAKE} LINGUA=en $@
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
151
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
152 build/$(LINGUA)/source/hgbook.xml: build/en/source/hgbook.xml po/$(LINGUA).po $(images)
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
153 mkdir -p build/$(LINGUA)/source/figs
756
1e020cb7d417 Remove tools
Dongsheng Song <songdongsheng@live.cn>
parents: 753
diff changeset
154 cp en/figs/*.png build/$(LINGUA)/source/figs
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
155 $(TRANSLATE) -m build/en/source/hgbook.xml -p po/$(LINGUA).po -l $@.tmp
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
156 cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
157 endif
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 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
160
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
161 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
162 html:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
163 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
164 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
165 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
166 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
167 html: build/$(LINGUA)/html/index.html
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
168
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
169 build/$(LINGUA)/html/index.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html.xsl stylesheets/$(LINGUA)/html.xsl
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
170 mkdir -p build/$(LINGUA)/html/figs
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
171 cp en/figs/*.png build/$(LINGUA)/html/figs
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
172 cp stylesheets/hgbook.css build/$(LINGUA)/html
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
173 xsltproc --output build/$(LINGUA)/html/ \
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
174 stylesheets/$(LINGUA)/html.xsl build/$(LINGUA)/source/hgbook.xml
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
175 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
176
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
177 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
178 html-single:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
179 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
180 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
181 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
182 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
183 html-single: build/$(LINGUA)/html-single/hgbook.html
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
184
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
185 build/$(LINGUA)/html-single/hgbook.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html-single.xsl stylesheets/$(LINGUA)/html-single.xsl
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
186 mkdir -p build/$(LINGUA)/html-single/figs
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
187 cp en/figs/*.png build/$(LINGUA)/html-single/figs
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
188 cp stylesheets/hgbook.css build/$(LINGUA)/html-single
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
189 xsltproc --output build/$(LINGUA)/html-single/hgbook.html \
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
190 stylesheets/$(LINGUA)/html-single.xsl build/$(LINGUA)/source/hgbook.xml
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
191 endif
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 ifndef LINGUA
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
194 pdf:
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
195 for l in $(LANGUAGES); do \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
196 $(MAKE) $@ LINGUA=$$l; \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
197 done
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
198 else
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
199 pdf: build/$(LINGUA)/pdf/hgbook.pdf
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
200
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
201 build/$(LINGUA)/pdf/hgbook.pdf: build/$(LINGUA)/source/hgbook.xml stylesheets/fo.xsl stylesheets/$(LINGUA)/fo.xsl
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
202 mkdir -p build/$(LINGUA)/pdf
756
1e020cb7d417 Remove tools
Dongsheng Song <songdongsheng@live.cn>
parents: 753
diff changeset
203 java -classpath $(JAVA_SHARE)/saxon65.jar:$(JAVA_SHARE)/saxon65-dbxsl.jar:$(JAVA_SHARE)/xml-commons-resolver-1.2.jar:$(JAVA_SHARE) \
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
204 com.icl.saxon.StyleSheet \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
205 -x org.apache.xml.resolver.tools.ResolvingXMLReader \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
206 -y org.apache.xml.resolver.tools.ResolvingXMLReader \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
207 -r org.apache.xml.resolver.tools.CatalogResolver \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
208 -o build/$(LINGUA)/source/hgbook.fo \
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
209 build/$(LINGUA)/source/hgbook.xml \
728
bae6d1503482 Rename xsl to stylesheets
Dongsheng Song <dongsheng.song@gmail.com>
parents: 727
diff changeset
210 stylesheets/$(LINGUA)/fo.xsl \
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
211 fop1.extensions=1
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
212
756
1e020cb7d417 Remove tools
Dongsheng Song <songdongsheng@live.cn>
parents: 753
diff changeset
213 (cd build/$(LINGUA)/source && $(FOP_HOME)/fop.sh hgbook.fo ../pdf/hgbook.pdf)
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
214 endif
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
215
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
216 en/figs/%.png: en/figs/%.svg en/fixsvg
732
74da9b315396 Cleanup thoroughly, and run fixsvg when generate png files
Dongsheng Song <dongsheng.song@gmail.com>
parents: 728
diff changeset
217 en/fixsvg $<
74da9b315396 Cleanup thoroughly, and run fixsvg when generate png files
Dongsheng Song <dongsheng.song@gmail.com>
parents: 728
diff changeset
218 inkscape -D -d 120 -e $@ $<-tmp.svg
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
219
753
1c13ed2130a7 Merge with http://hg.serpentine.com/mercurial/book
Dongsheng Song <dongsheng.song@gmail.com>
parents: 732
diff changeset
220 en/figs/%.svg: en/figs/%.dot
725
83a687a996b2 Basically completed Docbook xml make environment
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
221 dot -Tsvg -o $@ $<