Mercurial > hgbook
annotate en/Makefile @ 693:0b45854f0b7b
Generate and include images properly.
| author | Bryan O'Sullivan <bos@serpentine.com> |
|---|---|
| date | Thu, 26 Mar 2009 22:00:53 -0700 |
| parents | 188efaefe001 |
| children | e0a4ba81f888 |
| 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 |
|
693
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
3 image-sources := $(wildcard figs/*.dot figs/*.png figs/*.svg) |
| 103 | 4 |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
5 xml-src-files := \ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
6 00book.xml \ |
|
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
7 app*.xml \ |
|
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
8 ch*.xml |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
9 |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
10 image-dot := $(filter %.dot,$(image-sources)) |
| 103 | 11 image-svg := $(filter %.svg,$(image-sources)) |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
12 image-png := $(filter %.png,$(image-sources)) |
| 11 | 13 |
|
693
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
14 obj-web := html |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
15 obj-websup := $(obj-web)/support |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
16 obj-web-read := $(obj-web)/read |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
17 |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
18 image-web := \ |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
19 $(image-dot:%.dot=$(obj-web-read)/%.png) \ |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
20 $(image-svg:%.svg=$(obj-web-read)/%.png) \ |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
21 $(image-png:%=$(obj-web-read)/%) |
|
213
18cffee85038
Fix build of HTML pages with PNG images.
Bryan O'Sullivan <bos@serpentine.com>
parents:
202
diff
changeset
|
22 |
|
680
8366882f67f2
Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents:
674
diff
changeset
|
23 example-sources-by-name := \ |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
24 backout \ |
|
131
153efeaa8f57
Fix stupid build bugs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
124
diff
changeset
|
25 bisect \ |
|
179
5fc4a45c069f
Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents:
177
diff
changeset
|
26 branching \ |
|
202
6f167e644762
Start writing about named branches.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
27 branch-named \ |
|
198
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
196
diff
changeset
|
28 branch-repo \ |
|
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
29 cmdref \ |
|
117
6b0f4498569e
Beef up daily routine material. Focus on merge-across-copy.
Bryan O'Sullivan <bos@serpentine.com>
parents:
115
diff
changeset
|
30 daily.copy \ |
| 86 | 31 daily.files \ |
|
118
1ee53cb37a99
More progress on daily work.
Bryan O'Sullivan <bos@serpentine.com>
parents:
117
diff
changeset
|
32 daily.rename \ |
|
122
3af28630fe8c
How to goodbye depression by reverting one thousand times daily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
121
diff
changeset
|
33 daily.revert \ |
|
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
34 extdiff \ |
|
133
1e013fbe35f7
Lots of filename related content. A little more command reference
Bryan O'Sullivan <bos@serpentine.com>
parents:
132
diff
changeset
|
35 filenames \ |
| 86 | 36 hook.msglen \ |
| 37 hook.simple \ | |
| 38 hook.ws \ | |
|
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
153
diff
changeset
|
39 issue29 \ |
|
104
32bf9a5f22c0
Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
103
diff
changeset
|
40 mq.guards \ |
| 86 | 41 mq.qinit-help \ |
| 42 mq.dodiff \ | |
| 43 mq.id \ | |
| 44 mq.tarball \ | |
| 45 mq.tools \ | |
| 46 mq.tutorial \ | |
|
156
91a936be78b8
Document merge behaviour with file names.
Bryan O'Sullivan <bos@serpentine.com>
parents:
153
diff
changeset
|
47 rename.divergent \ |
|
121
9094c9fda8ec
Start chapter on error recovery.
Bryan O'Sullivan <bos@serpentine.com>
parents:
118
diff
changeset
|
48 rollback \ |
|
196
4237e45506ee
Add early material describing tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
195
diff
changeset
|
49 tag \ |
| 86 | 50 template.simple \ |
| 87 | 51 template.svnstyle \ |
| 103 | 52 tour \ |
| 53 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
|
54 |
|
680
8366882f67f2
Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents:
674
diff
changeset
|
55 example-sources := \ |
|
8366882f67f2
Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents:
674
diff
changeset
|
56 $(example-sources-by-name:%=examples/%) \ |
|
8366882f67f2
Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents:
674
diff
changeset
|
57 $(wildcard examples/ch*/*) |
|
8366882f67f2
Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents:
674
diff
changeset
|
58 |
|
674
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
59 extras-web-base := \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
60 $(obj-web)/index.html \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
61 $(obj-web)/robots.txt \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
62 $(obj-websup)/form-min.js \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
63 $(obj-websup)/form.js \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
64 $(obj-websup)/hsbook.js \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
65 $(obj-websup)/jquery-min.js \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
66 $(obj-websup)/jquery.js \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
67 $(obj-websup)/styles.css |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
68 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
69 extras-web := $(extras-web-base) $(extras-web-base:%=%.gz) |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
70 |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
71 xsltproc := xsltproc |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
72 xsltproc-opts := --nonet --xinclude --path '$(xml-path)' |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
73 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
74 xmllint := xmllint |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
75 xmllint-opts := --noout --nonet --valid |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
76 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
77 system-xsl-dir := $(firstword $(wildcard \ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
78 /usr/share/sgml/docbook/xsl-stylesheets \ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
79 /usr/share/xml/docbook/stylesheet/nwalsh \ |
|
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 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
82 # Bletcherousness. |
|
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 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
|
85 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
|
86 else |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
87 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
|
88 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
|
89 else |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
90 $(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
|
91 endif |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
92 endif |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
93 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
94 ifeq ($(system-xsl-dir),) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
95 $(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
|
96 endif |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
97 |
|
172
5f305adeb584
Try to tighten up the run environment to make things more reproducible.
Bryan O'Sullivan <bos@serpentine.com>
parents:
171
diff
changeset
|
98 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
|
99 /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
|
100 |
|
157
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
101 dist-sources := \ |
|
159
7355af913937
First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
157
diff
changeset
|
102 ../html/hgicon.png \ |
|
157
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
103 ../html/index.html.var \ |
|
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
104 ../html/index.en.html |
|
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
105 |
|
177
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
106 hg = $(shell which hg) |
|
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
107 |
|
269
abfe426f7e08
Kill off the hideous pink text from HTML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
250
diff
changeset
|
108 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
|
109 |
|
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
110 hg-version = $(shell hg version -q | \ |
|
242
0d536cb488f2
Allow revs with uncommitted changes.
Bryan O'Sullivan <bos@serpentine.com>
parents:
226
diff
changeset
|
111 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
|
112 |
|
674
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
113 all: web |
|
149
16f02802f448
Start to produce saner HTML and CSS.
Bryan O'Sullivan <bos@serpentine.com>
parents:
146
diff
changeset
|
114 |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
115 ../xsl/system-xsl: $(system-xsl-dir) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
116 ln -s $< $@ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
117 |
| 678 | 118 web: ../xsl/system-xsl websup html |
|
674
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
119 |
|
693
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
120 html: $(obj-web-read)/index.html |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
121 |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
122 $(obj-web-read)/index.html: ../xsl/system-xsl .validated-00book.xml |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
123 xsltproc $(xsltproc-opts) -o $(obj-web-read)/x ../xsl/chunk-stylesheet.xsl 00book.xml |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
124 for i in $(obj-web-read)/*.html; do \ |
|
674
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
125 gzip -9 -c $$i > $$i.gz; \ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
126 done |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
127 |
|
693
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
128 websup: $(extras-web) $(image-web) |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
129 mkdir -p $(obj-websup)/figs $(obj-web-read)/figs |
|
674
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
130 cp ../xsl/system-xsl/images/*.png $(obj-websup)/figs |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
131 cp -f ../web/icons/*.png $(obj-websup)/figs |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
132 |
|
687
188efaefe001
How to make all-ids.dat.
Bryan O'Sullivan <bos@serpentine.com>
parents:
681
diff
changeset
|
133 all-ids.dat: ../xsl/all-ids.xsl $(xml-src-files) |
|
188efaefe001
How to make all-ids.dat.
Bryan O'Sullivan <bos@serpentine.com>
parents:
681
diff
changeset
|
134 $(xsltproc) $(xsltproc-opts) -o $@ ../xsl/all-ids.xsl 00book.xml |
|
188efaefe001
How to make all-ids.dat.
Bryan O'Sullivan <bos@serpentine.com>
parents:
681
diff
changeset
|
135 |
|
674
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
136 web: websup |
|
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
137 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
138 valid: .validated-00book.xml |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
139 |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
140 .validated-00book.xml: $(xml-src-files) |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
141 $(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $< |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
142 touch $@ |
|
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
649
diff
changeset
|
143 |
|
18
e6f4088ebe52
Generate a PDF file with a feedback link on each paragraph.
Bryan O'Sullivan <bos@serpentine.com>
parents:
16
diff
changeset
|
144 # 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
|
145 |
|
693
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
146 $(obj-web-read)/figs/%.png: $(obj-web-read)/figs/%.svg fixsvg |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
147 mkdir -p $(dir $@) |
| 406 | 148 ./fixsvg $< |
| 408 | 149 inkscape -D -e $@ $<-tmp.svg |
| 150 rm $<-tmp.svg | |
|
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
151 |
|
693
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
152 $(obj-web-read)/figs/%.png: figs/%.svg fixsvg |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
153 mkdir -p $(dir $@) |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
154 ./fixsvg $< |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
155 inkscape -D -e $@ $<-tmp.svg |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
156 rm $<-tmp.svg |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
157 |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
158 $(obj-web-read)/figs/%.png: figs/%.png |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
159 cp $< $@ |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
160 |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
161 $(obj-web-read)/figs/%.svg: figs/%.dot |
|
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
687
diff
changeset
|
162 mkdir -p $(dir $@) |
|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
163 dot -Tsvg -o $@ $< |
|
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
122
diff
changeset
|
164 |
|
172
5f305adeb584
Try to tighten up the run environment to make things more reproducible.
Bryan O'Sullivan <bos@serpentine.com>
parents:
171
diff
changeset
|
165 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
|
166 |
|
680
8366882f67f2
Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents:
674
diff
changeset
|
167 examples/.run: $(example-sources) |
|
8366882f67f2
Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents:
674
diff
changeset
|
168 cd examples && ./run-example |
|
45
6b7b0339e7d6
Don't rerun examples unnecessarily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
44
diff
changeset
|
169 |
|
6b7b0339e7d6
Don't rerun examples unnecessarily.
Bryan O'Sullivan <bos@serpentine.com>
parents:
44
diff
changeset
|
170 examples/%.run: examples/% examples/run-example |
|
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
171 |
|
670
3bcc001ce34f
Get rid of lots of TeX-era cruft.
Bryan O'Sullivan <bos@serpentine.com>
parents:
665
diff
changeset
|
172 clean: |
|
3bcc001ce34f
Get rid of lots of TeX-era cruft.
Bryan O'Sullivan <bos@serpentine.com>
parents:
665
diff
changeset
|
173 -rm -rf dist html $(image-dot:%.dot=%.pdf) $(image-dot:%.dot=%.png) \ |
|
3bcc001ce34f
Get rid of lots of TeX-era cruft.
Bryan O'Sullivan <bos@serpentine.com>
parents:
665
diff
changeset
|
174 $(image-svg:%.svg=%.png) examples/*.{lxo,run} examples/.run |
|
177
c54f4c106fd5
Record the version of Mercurial used.
Bryan O'Sullivan <bos@serpentine.com>
parents:
172
diff
changeset
|
175 |
|
670
3bcc001ce34f
Get rid of lots of TeX-era cruft.
Bryan O'Sullivan <bos@serpentine.com>
parents:
665
diff
changeset
|
176 install: html $(dist-sources) |
|
153
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
177 rm -rf dist |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
178 mkdir -p dist |
|
670
3bcc001ce34f
Get rid of lots of TeX-era cruft.
Bryan O'Sullivan <bos@serpentine.com>
parents:
665
diff
changeset
|
179 cp html/*.{css,html,png} dist |
|
157
e49f4451d0e3
Add hgbook front page material.
Bryan O'Sullivan <bos@serpentine.com>
parents:
156
diff
changeset
|
180 cp $(dist-sources) dist |
|
153
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
181 |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
182 rsync: install |
|
cf24633b8de7
Set up simple distribution rules.
Bryan O'Sullivan <bos@serpentine.com>
parents:
149
diff
changeset
|
183 rsync -avz --delete dist sp.red-bean.com:public_html/hgbook |
|
674
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
184 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
185 vpath %.css ../web |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
186 vpath %.js ../web/javascript |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
187 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
188 $(obj-websup)/%.css: %.css |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
189 @mkdir -p $(dir $@) |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
190 cp $< $@ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
191 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
192 $(obj-websup)/%.jpg: %.jpg |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
193 @mkdir -p $(dir $@) |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
194 cp $< $@ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
195 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
196 $(obj-websup)/%.js: %.js |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
197 @mkdir -p $(dir $@) |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
198 cp $< $@ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
199 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
200 $(obj-web)/%: ../web/% |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
201 @mkdir -p $(dir $@) |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
202 cp $< $@ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
203 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
204 $(obj-web)/%.html: %.html.in |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
205 @mkdir -p $(dir $@) |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
206 python ../web/texpand.py $< $@ |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
207 |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
208 %.gz: % |
|
bebd5ff7fe7f
And there was much tidying, and the result was good.
Bryan O'Sullivan <bos@serpentine.com>
parents:
670
diff
changeset
|
209 gzip -9 -c $< > $@ |
