annotate ja/Makefile.tex @ 800:1a30d2627512

Propagate 2ff0a43f1152 Update ch03
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 18 Jun 2009 20:04:44 +0900
parents 4cf1bbfe4d2c
children b775f963b18c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
777
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
1 # This makefile requires GNU make.
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
2
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
3 sources := \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
4 00book.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
5 99book.bib \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
6 99defs.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
7 build_id.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
8 branch.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
9 cmdref.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
10 collab.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
11 concepts.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
12 daily.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
13 filenames.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
14 hg_id.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
15 hgext.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
16 hook.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
17 intro.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
18 mq.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
19 mq-collab.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
20 mq-ref.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
21 preface.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
22 srcinstall.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
23 template.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
24 tour-basic.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
25 tour-merge.tex \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
26 undo.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
27
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
28 image-sources := \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
29 feature-branches.dot \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
30 filelog.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
31 kdiff3.png \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
32 metadata.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
33 mq-stack.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
34 note.png \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
35 revlog.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
36 snapshot.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
37 tour-history.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
38 tour-merge-conflict.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
39 tour-merge-merge.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
40 tour-merge-pull.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
41 tour-merge-sep-repos.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
42 undo-manual.dot \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
43 undo-manual-merge.dot \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
44 undo-non-tip.dot \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
45 undo-simple.dot \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
46 wdir.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
47 wdir-after-commit.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
48 wdir-branch.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
49 wdir-merge.svg \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
50 wdir-pre-branch.svg
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
51
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
52 image-dot := $(filter %.dot,$(image-sources))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
53 image-svg := $(filter %.svg,$(image-sources))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
54 image-png := $(filter %.png,$(image-sources))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
55
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
56 image-pdf := $(image-dot:%.dot=%.pdf) $(image-svg:%.svg=%.pdf) $(image-png)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
57 image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
58 #image-eps := $(image-dot:%.dot=%.eps) $(image-svg:%.svg=%.eps) $(image-png)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
59 image-eps := $(image-dot:%.dot=%.eps) $(image-svg:%.svg=%.eps) $(image-png:%.png=%.eps)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
60
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
61 example-sources := \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
62 backout \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
63 bisect \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
64 branching \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
65 branch-named \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
66 branch-repo \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
67 cmdref \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
68 daily.copy \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
69 daily.files \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
70 daily.rename \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
71 daily.revert \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
72 extdiff \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
73 filenames \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
74 hook.msglen \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
75 hook.simple \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
76 hook.ws \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
77 issue29 \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
78 mq.guards \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
79 mq.qinit-help \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
80 mq.dodiff \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
81 mq.id \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
82 mq.tarball \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
83 mq.tools \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
84 mq.tutorial \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
85 rename.divergent \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
86 rollback \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
87 tag \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
88 template.simple \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
89 template.svnstyle \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
90 tour \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
91 tour-merge-conflict
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
92
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
93 example-prereqs := \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
94 /usr/bin/merge
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
95
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
96 dist-sources := \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
97 ../html/hgicon.png \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
98 ../html/index.html.var \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
99 ../html/index.en.html
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
100
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
101 latex-options = \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
102 -interaction batchmode \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
103 -output-directory $(dir $(1)) \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
104 -jobname $(basename $(notdir $(1)))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
105
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
106 hg = $(shell which hg)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
107
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
108 hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n')
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
109
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
110 hg-version = $(shell hg version -q | \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
111 sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,')
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
112
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
113 all: dvi
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
114
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
115 #dvi: $(sources) $(image-eps) examples
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
116 dvi: $(sources) $(image-eps)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
117 platex 00book.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
118
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
119 cp 00book.aux hgbook.aux
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
120 bibtex hgbook
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
121
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
122 platex 00book.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
123 platex 00book.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
124 platex 00book.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
125
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
126
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
127
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
128
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
129
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
130
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
131 pdf: pdf/hgbook.pdf
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
132
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
133 define pdf
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
134 mkdir -p $(dir $@)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
135 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
136
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
137 cp 99book.bib $(dir $@)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
138
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
139 cd $(dir $@) && bibtex $(basename $(notdir $@))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
140 cd $(dir $@) && makeindex $(basename $(notdir $@))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
141
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
142 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
143 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
144 if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
145 endef
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
146
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
147 #pdf/hgbook.pdf: $(sources) $(image-pdf) examples
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
148 pdf/hgbook.pdf: $(sources) $(image-pdf)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
149 $(call pdf)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
150
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
151 html: onepage split
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
152
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
153 onepage: $(htlatex) html/onepage/hgbook.html html/onepage/hgbook.css $(image-html:%=html/onepage/%)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
154
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
155 html/onepage/%: %
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
156 cp $< $@
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
157
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
158 split: $(htlatex) html/split/hgbook.html html/split/hgbook.css $(image-html:%=html/split/%)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
159
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
160 html/split/%: %
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
161 cp $< $@
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
162
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
163 # This is a horrible hack to work around the fact that the htlatex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
164 # command in tex4ht is itself a horrible hack. I really don't want to
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
165 # include verbatim the big wad of TeX that is repeated in that script,
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
166 # but I've given up and run a hacked copy as htlatex.book here.
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
167
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
168 define htlatex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
169 mkdir -p $(dir $(1))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
170 cp 99book.bib $(dir $(1))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
171 TEXINPUTS=$(dir $(2)): ./htlatex.book $(2) "bookhtml,html4-uni,$(3)" " -cunihtf -utf8" "$(dir $(1))" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
172 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
173 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1)))
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
174 ./fixhtml.py $(dir $(1))/*.html
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
175 rm $(dir $(1))/hgbook.css
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
176 endef
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
177
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
178 #html/onepage/hgbook.html: $(sources) $(image-html) examples bookhtml.cfg
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
179 html/onepage/hgbook.html: $(sources) $(image-html) bookhtml.cfg
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
180 $(call htlatex,$@,$<)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
181
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
182 #html/split/hgbook.html: $(sources) examples bookhtml.cfg
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
183 html/split/hgbook.html: $(sources) bookhtml.cfg
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
184 $(call htlatex,$@,$<,2)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
185
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
186 # Produce 90dpi PNGs for the web.
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
187
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
188 %.png: %.svg
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
189 inkscape -D -e $@ $<
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
190
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
191 %.svg: %.dot
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
192 dot -Tsvg -o $@ $<
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
193
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
194 # Produce eps & pdf for the pdf
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
195
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
196 %.pdf: %.eps
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
197 epstopdf $<
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
198
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
199 %.eps: %.svg
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
200 inkscape -E $@ $<
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
201
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
202 %.eps: %.dot
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
203 dot -Tps -o $@ $<
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
204
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
205 %.eps: %.png
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
206 convert $< ps:$@
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
207
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
208 examples: $(example-prereqs) examples/.run
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
209
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
210 examples/.run: $(example-sources:%=examples/%.run)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
211 touch examples/.run
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
212
789
4cf1bbfe4d2c restore the script to generate examples for tex.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 777
diff changeset
213 examples/%.run: examples/% examples/run-example-tex
4cf1bbfe4d2c restore the script to generate examples for tex.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 777
diff changeset
214 cd examples && ./run-example-tex $(notdir $<)
777
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
215
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
216 changelog := $(wildcard ../.hg/store/00changelog.[id])
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
217 ifeq ($(changelog),)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
218 changelog := $(wildcard ../.hg/00changelog.[id])
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
219 endif
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
220
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
221 build_id.tex: $(changelog)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
222 echo -n '$(hg-id)' > build_id.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
223
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
224 hg_id.tex: $(hg)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
225 echo -n '$(hg-version)' > hg_id.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
226
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
227 clean:
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
228 rm -rf dist html pdf \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
229 $(image-dot:%.dot=%.pdf) \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
230 $(image-dot:%.dot=%.png) \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
231 $(image-svg:%.svg=%.pdf) \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
232 $(image-svg:%.svg=%.png) \
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
233 examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
234
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
235 install: pdf split $(dist-sources)
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
236 rm -rf dist
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
237 mkdir -p dist
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
238 cp pdf/hgbook.pdf dist
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
239 cp html/split/*.{css,html,png} dist
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
240 cp $(dist-sources) dist
3274ff6650df add old Makefile for tex compilation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
241