annotate Makefile @ 821:88828b784971

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