Mercurial > hgbook
annotate en/Makefile @ 658:b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
| author | Bryan O'Sullivan <bos@serpentine.com> |
|---|---|
| date | Wed, 18 Feb 2009 00:22:09 -0800 |
| parents | 8631da51309b |
| children | 27043f385f3f |
| rev | line source |
|---|---|
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
1 # This makefile requires GNU make. |
|
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
2 |
| 2 | 3 sources := \ |
| 4 00book.tex \ | |
| 5 99book.bib \ | |
| 6 99defs.tex \ | |
|
649
5cd47f721686
Rename LaTeX input files to have numeric prefixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
409
diff
changeset
|
7 app*.tex \ |
|
5cd47f721686
Rename LaTeX input files to have numeric prefixes
Bryan O'Sullivan <bos@serpentine.com>
parents:
409
diff
changeset
|
8 ch*.tex |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
9 |
| 11 | 10 image-sources := \ |
|
179
5fc4a45c069f
Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents:
177
diff
changeset
|
11 feature-branches.dot \ |
|
108
e0b961975c5e
First bit of concepts chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
104
diff
changeset
|
12 filelog.svg \ |
| 103 | 13 kdiff3.png \ |
|
109
1b67dc96f27a
Snapshot of concepts chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
108
diff
changeset
|
14 metadata.svg \ |
|
96
7d7ddc3a57af
Split tour into two chapters.
Bryan O'Sullivan <bos@serpentine.com>
parents:
95
diff
changeset
|
15 mq-stack.svg \ |
|
149
16f02802f448
Start to produce saner HTML and CSS.
Bryan O'Sullivan <bos@serpentine.com>
parents:
146
diff
changeset
|
16 note.png \ |
| 112 | 17 revlog.svg \ |
| 110 | 18 snapshot.svg \ |
| 99 | 19 tour-history.svg \ |
| 103 | 20 tour-merge-conflict.svg \ |
| 21 tour-merge-merge.svg \ | |
|
100
272146fab009
Add yet another illustration of the merge process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
99
diff
changeset
|
22 tour-merge-pull.svg \ |
|
113
a0f57b3e677e
More concepts, this time working directory stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
112
diff
changeset
|
23 tour-merge-sep-repos.svg \ |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
24 undo-manual.dot \ |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
25 undo-manual-merge.dot \ |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
26 undo-non-tip.dot \ |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
27 undo-simple.dot \ |
|
113
a0f57b3e677e
More concepts, this time working directory stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
112
diff
changeset
|
28 wdir.svg \ |
|
115
b74102b56df5
Wow! Lots more work detailing the working directory, merging, etc.
Bryan O'Sullivan <bos@serpentine.com>
parents:
113
diff
changeset
|
29 wdir-after-commit.svg \ |
|
b74102b56df5
Wow! Lots more work detailing the working directory, merging, etc.
Bryan O'Sullivan <bos@serpentine.com>
parents:
113
diff
changeset
|
30 wdir-branch.svg \ |
|
b74102b56df5
Wow! Lots more work detailing the working directory, merging, etc.
Bryan O'Sullivan <bos@serpentine.com>
parents:
113
diff
changeset
|
31 wdir-merge.svg \ |
|
b74102b56df5
Wow! Lots more work detailing the working directory, merging, etc.
Bryan O'Sullivan <bos@serpentine.com>
parents:
113
diff
changeset
|
32 wdir-pre-branch.svg |
| 103 | 33 |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
34 xml-src-files := \ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
35 00book.xml \ |
|
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
36 app*.xml \ |
|
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
37 ch*.xml |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
38 |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
39 image-dot := $(filter %.dot,$(image-sources)) |
| 103 | 40 image-svg := $(filter %.svg,$(image-sources)) |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
41 image-png := $(filter %.png,$(image-sources)) |
| 11 | 42 |
|
213
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
43 image-pdf := $(image-dot:%.dot=%.pdf) $(image-svg:%.svg=%.pdf) $(image-png) |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
44 image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png) |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
45 |
|
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
46 example-sources := \ |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
47 backout \ |
|
131
153efeaa8f57
Fix stupid build bugs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
124
diff
changeset
|
48 bisect \ |
|
179
5fc4a45c069f
Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents:
177
diff
changeset
|
49 branching \ |
|
202
6f167e644762
Start writing about named branches.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
50 branch-named \ |
|
198
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
196
diff
changeset
|
51 branch-repo \ |
|
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
52 cmdref \ |
|
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
115
diff
changeset
|
53 daily.copy \ |
| 86 | 54 daily.files \ |
|
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
55 daily.rename \ |
|
122
3af28630fe8c
How to goodbye depression by reverting one thousand times daily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
56 daily.revert \ |
|
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
57 extdiff \ |
|
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
58 filenames \ |
| 86 | 59 hook.msglen \ |
| 60 hook.simple \ | |
| 61 hook.ws \ | |
|
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
153
diff
changeset
|
62 issue29 \ |
|
104
32bf9a5f22c0
Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
103
diff
changeset
|
63 mq.guards \ |
| 86 | 64 mq.qinit-help \ |
| 65 mq.dodiff \ | |
| 66 mq.id \ | |
| 67 mq.tarball \ | |
| 68 mq.tools \ | |
| 69 mq.tutorial \ | |
|
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
153
diff
changeset
|
70 rename.divergent \ |
|
121
9094c9fda8ec
Start chapter on error recovery.
Bryan O'Sullivan <bos@serpentine.com>
parents:
118
diff
changeset
|
71 rollback \ |
|
196
4237e45506ee
Add early material describing tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
195
diff
changeset
|
72 tag \ |
| 86 | 73 template.simple \ |
| 87 | 74 template.svnstyle \ |
| 103 | 75 tour \ |
| 76 tour-merge-conflict | |
|
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
77 |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
78 xsltproc := xsltproc |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
79 xsltproc-opts := --nonet --xinclude --path '$(xml-path)' |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
80 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
81 xmllint := xmllint |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
82 xmllint-opts := --noout --nonet --valid |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
83 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
84 system-xsl-dir := $(firstword $(wildcard \ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
85 /usr/share/sgml/docbook/xsl-stylesheets \ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
86 /usr/share/xml/docbook/stylesheet/nwalsh \ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
87 )) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
88 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
89 # Bletcherousness. |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
90 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
91 ifneq ($(wildcard /usr/share/sgml/docbook/xml-dtd-4.4-*),) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
92 dtd-dir := $(wildcard /usr/share/sgml/docbook/xml-dtd-4.4-*) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
93 else |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
94 ifneq ($(wildcard /usr/share/xml/docbook/schema/dtd/4.4),) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
95 dtd-dir := $(wildcard /usr/share/xml/docbook/schema/dtd/4.4) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
96 else |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
97 $(error Do not know where to look for DocBook XML 4.4 DTD) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
98 endif |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
99 endif |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
100 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
101 ifeq ($(system-xsl-dir),) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
102 $(error add a suitable directory to system-xsl-dir) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
103 endif |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
104 |
|
172
5f305adeb584
Try to tighten up the run environment to make things more reproducible.
Bryan O'Sullivan <bos@serpentine.com>
parents:
171
diff
changeset
|
105 example-prereqs := \ |
|
5f305adeb584
Try to tighten up the run environment to make things more reproducible.
Bryan O'Sullivan <bos@serpentine.com>
parents:
171
diff
changeset
|
106 /usr/bin/merge |
|
5f305adeb584
Try to tighten up the run environment to make things more reproducible.
Bryan O'Sullivan <bos@serpentine.com>
parents:
171
diff
changeset
|
107 |
|
157
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
108 dist-sources := \ |
|
159
7355af913937
First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
157
diff
changeset
|
109 ../html/hgicon.png \ |
|
157
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
110 ../html/index.html.var \ |
|
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
111 ../html/index.en.html |
|
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
112 |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
113 latex-options = \ |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
114 -interaction batchmode \ |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
115 -output-directory $(dir $(1)) \ |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
116 -jobname $(basename $(notdir $(1))) |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
117 |
|
177
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
118 hg = $(shell which hg) |
|
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
119 |
|
269
abfe426f7e08
Kill off the hideous pink text from HTML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
250
diff
changeset
|
120 hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n') |
|
177
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
121 |
|
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
122 hg-version = $(shell hg version -q | \ |
|
242
0d536cb488f2
Allow revs with uncommitted changes.
Bryan O'Sullivan <bos@serpentine.com>
parents:
226
diff
changeset
|
123 sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,') |
|
177
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
124 |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
125 all: pdf html |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
126 |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
127 pdf: pdf/hgbook.pdf |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
128 |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
129 define pdf |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
130 mkdir -p $(dir $@) |
|
21
ce3339dbeb6f
Get beta feedback stuff into better shape.
Bryan O'Sullivan <bos@serpentine.com>
parents:
18
diff
changeset
|
131 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
| 2 | 132 cp 99book.bib $(dir $@) |
| 133 cd $(dir $@) && bibtex $(basename $(notdir $@)) | |
|
16
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
134 cd $(dir $@) && makeindex $(basename $(notdir $@)) |
|
21
ce3339dbeb6f
Get beta feedback stuff into better shape.
Bryan O'Sullivan <bos@serpentine.com>
parents:
18
diff
changeset
|
135 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
|
ce3339dbeb6f
Get beta feedback stuff into better shape.
Bryan O'Sullivan <bos@serpentine.com>
parents:
18
diff
changeset
|
136 TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
| 26 | 137 if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
138 endef |
|
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
139 |
| 406 | 140 pdf/hgbook.pdf: $(sources) examples $(image-pdf) |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
141 $(call pdf) |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
142 |
|
149
16f02802f448
Start to produce saner HTML and CSS.
Bryan O'Sullivan <bos@serpentine.com>
parents:
146
diff
changeset
|
143 html: onepage split |
|
16f02802f448
Start to produce saner HTML and CSS.
Bryan O'Sullivan <bos@serpentine.com>
parents:
146
diff
changeset
|
144 |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
145 ../xsl/system-xsl: $(system-xsl-dir) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
146 ln -s $< $@ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
147 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
148 dbhtml: ../xsl/system-xsl $(xml-src-files) valid |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
149 xsltproc $(xsltproc-opts) ../xsl/chunk-stylesheet.xsl 00book.xml |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
150 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
151 valid: .validated-00book.xml |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
152 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
153 .validated-00book.xml: $(xml-src-files) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
154 $(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $< |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
155 touch $@ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
156 |
|
213
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
157 onepage: $(htlatex) html/onepage/hgbook.html html/onepage/hgbook.css $(image-html:%=html/onepage/%) |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
158 |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
159 html/onepage/%: % |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
160 cp $< $@ |
|
171
8c1703a98266
Add a dependency on htlatex to HTML targets, even though we don't call it.
Bryan O'Sullivan <bos@serpentine.com>
parents:
170
diff
changeset
|
161 |
|
213
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
162 split: $(htlatex) html/split/hgbook.html html/split/hgbook.css $(image-html:%=html/split/%) |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
163 |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
164 html/split/%: % |
|
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
165 cp $< $@ |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
166 |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
167 # This is a horrible hack to work around the fact that the htlatex |
|
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
168 # command in tex4ht is itself a horrible hack. I really don't want to |
|
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
169 # include verbatim the big wad of TeX that is repeated in that script, |
|
171
8c1703a98266
Add a dependency on htlatex to HTML targets, even though we don't call it.
Bryan O'Sullivan <bos@serpentine.com>
parents:
170
diff
changeset
|
170 # but I've given up and run a hacked copy as htlatex.book here. |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
171 |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
172 define htlatex |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
173 mkdir -p $(dir $(1)) |
|
170
9cd856b4bd21
Try to make HTML build a bit more portable.
Bryan O'Sullivan <bos@serpentine.com>
parents:
159
diff
changeset
|
174 cp 99book.bib $(dir $(1)) |
|
9cd856b4bd21
Try to make HTML build a bit more portable.
Bryan O'Sullivan <bos@serpentine.com>
parents:
159
diff
changeset
|
175 TEXINPUTS=$(dir $(2)): ./htlatex.book $(2) "bookhtml,html4-uni,$(3)" " -cunihtf -utf8" "$(dir $(1))" "$(call latex-options,$(1))" || (rm -f $(1); exit 1) |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
176 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
177 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) |
|
149
16f02802f448
Start to produce saner HTML and CSS.
Bryan O'Sullivan <bos@serpentine.com>
parents:
146
diff
changeset
|
178 ./fixhtml.py $(dir $(1))/*.html |
|
214
154e4ba293e7
Delete the hgbook.css file generated by htlatex.
Bryan O'Sullivan <bos@serpentine.com>
parents:
213
diff
changeset
|
179 rm $(dir $(1))/hgbook.css |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
180 endef |
|
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
181 |
| 406 | 182 html/onepage/hgbook.html: $(sources) examples $(image-html) bookhtml.cfg |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
183 $(call htlatex,$@,$<) |
| 11 | 184 |
|
213
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
185 html/split/hgbook.html: $(sources) examples bookhtml.cfg |
| 11 | 186 $(call htlatex,$@,$<,2) |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
187 |
|
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
188 # Produce 90dpi PNGs for the web. |
|
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
189 |
| 408 | 190 %.png: %.svg fixsvg |
| 406 | 191 ./fixsvg $< |
| 408 | 192 inkscape -D -e $@ $<-tmp.svg |
| 193 rm $<-tmp.svg | |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
194 |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
195 %.svg: %.dot |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
196 dot -Tsvg -o $@ $< |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
197 |
|
30
cc1e6f1d7161
Use PDF instead of PNG for images in the PDF book
Josef "Jeff" Sipek <jeffpc@josefsipek.net>
parents:
26
diff
changeset
|
198 # Produce eps & pdf for the pdf |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
199 |
|
30
cc1e6f1d7161
Use PDF instead of PNG for images in the PDF book
Josef "Jeff" Sipek <jeffpc@josefsipek.net>
parents:
26
diff
changeset
|
200 %.pdf: %.eps |
|
cc1e6f1d7161
Use PDF instead of PNG for images in the PDF book
Josef "Jeff" Sipek <jeffpc@josefsipek.net>
parents:
26
diff
changeset
|
201 epstopdf $< |
|
cc1e6f1d7161
Use PDF instead of PNG for images in the PDF book
Josef "Jeff" Sipek <jeffpc@josefsipek.net>
parents:
26
diff
changeset
|
202 |
|
cc1e6f1d7161
Use PDF instead of PNG for images in the PDF book
Josef "Jeff" Sipek <jeffpc@josefsipek.net>
parents:
26
diff
changeset
|
203 %.eps: %.svg |
| 406 | 204 ./fixsvg $< |
|
409
4d2fb4251217
Fix svg -> eps conversion.
Guido Ostkamp <hg@ostkamp.fastmail.fm>
parents:
408
diff
changeset
|
205 inkscape -E $@ $<-tmp.svg |
|
4d2fb4251217
Fix svg -> eps conversion.
Guido Ostkamp <hg@ostkamp.fastmail.fm>
parents:
408
diff
changeset
|
206 rm $<-tmp.svg |
| 11 | 207 |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
208 %.eps: %.dot |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
209 dot -Tps -o $@ $< |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
210 |
|
172
5f305adeb584
Try to tighten up the run environment to make things more reproducible.
Bryan O'Sullivan <bos@serpentine.com>
parents:
171
diff
changeset
|
211 examples: $(example-prereqs) examples/.run |
|
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
212 |
| 86 | 213 examples/.run: $(example-sources:%=examples/%.run) |
|
45
6b7b0339e7d6
Don't rerun examples unnecessarily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
44
diff
changeset
|
214 touch examples/.run |
|
6b7b0339e7d6
Don't rerun examples unnecessarily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
44
diff
changeset
|
215 |
|
6b7b0339e7d6
Don't rerun examples unnecessarily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
44
diff
changeset
|
216 examples/%.run: examples/% examples/run-example |
|
6b7b0339e7d6
Don't rerun examples unnecessarily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
44
diff
changeset
|
217 cd examples && ./run-example $(notdir $<) |
|
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
218 |
|
250
5ecf66974def
Generate build_id.tex correctly regardless of repo format.
Bryan O'Sullivan <bos@serpentine.com>
parents:
249
diff
changeset
|
219 changelog := $(wildcard ../.hg/store/00changelog.[id]) |
|
5ecf66974def
Generate build_id.tex correctly regardless of repo format.
Bryan O'Sullivan <bos@serpentine.com>
parents:
249
diff
changeset
|
220 ifeq ($(changelog),) |
|
5ecf66974def
Generate build_id.tex correctly regardless of repo format.
Bryan O'Sullivan <bos@serpentine.com>
parents:
249
diff
changeset
|
221 changelog := $(wildcard ../.hg/00changelog.[id]) |
|
5ecf66974def
Generate build_id.tex correctly regardless of repo format.
Bryan O'Sullivan <bos@serpentine.com>
parents:
249
diff
changeset
|
222 endif |
|
5ecf66974def
Generate build_id.tex correctly regardless of repo format.
Bryan O'Sullivan <bos@serpentine.com>
parents:
249
diff
changeset
|
223 |
|
5ecf66974def
Generate build_id.tex correctly regardless of repo format.
Bryan O'Sullivan <bos@serpentine.com>
parents:
249
diff
changeset
|
224 build_id.tex: $(changelog) |
|
249
9d7388f3f483
/bin/sh fails when parsing unescaped parens
Johannes Hoff <wbunaarfubss@gmail.com>
parents:
242
diff
changeset
|
225 echo -n '$(hg-id)' > build_id.tex |
|
177
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
226 |
|
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
227 hg_id.tex: $(hg) |
|
249
9d7388f3f483
/bin/sh fails when parsing unescaped parens
Johannes Hoff <wbunaarfubss@gmail.com>
parents:
242
diff
changeset
|
228 echo -n '$(hg-version)' > hg_id.tex |
|
16
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
229 |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
230 clean: |
|
153
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
231 rm -rf dist html pdf \ |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
232 $(image-dot:%.dot=%.pdf) \ |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
233 $(image-dot:%.dot=%.png) \ |
| 103 | 234 $(image-svg:%.svg=%.pdf) \ |
| 235 $(image-svg:%.svg=%.png) \ | |
|
177
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
236 examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex |
|
153
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
237 |
|
157
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
238 install: pdf split $(dist-sources) |
|
153
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
239 rm -rf dist |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
240 mkdir -p dist |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
241 cp pdf/hgbook.pdf dist |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
242 cp html/split/*.{css,html,png} dist |
|
157
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
243 cp $(dist-sources) dist |
|
153
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
244 |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
245 rsync: install |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
246 rsync -avz --delete dist sp.red-bean.com:public_html/hgbook |
