comparison en/Makefile @ 674:bebd5ff7fe7f

And there was much tidying, and the result was good.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 10 Mar 2009 21:58:03 -0700
parents 3bcc001ce34f
children 1879ec732a28 8366882f67f2 c88aa4edf9df
comparison
equal deleted inserted replaced
673:ad304b606163 674:bebd5ff7fe7f
65 template.simple \ 65 template.simple \
66 template.svnstyle \ 66 template.svnstyle \
67 tour \ 67 tour \
68 tour-merge-conflict 68 tour-merge-conflict
69 69
70 obj-web := html
71 obj-websup := html/support
72
73 extras-web-base := \
74 $(obj-web)/index.html \
75 $(obj-web)/robots.txt \
76 $(obj-websup)/form-min.js \
77 $(obj-websup)/form.js \
78 $(obj-websup)/hsbook.js \
79 $(obj-websup)/jquery-min.js \
80 $(obj-websup)/jquery.js \
81 $(obj-websup)/styles.css
82
83 extras-web := $(extras-web-base) $(extras-web-base:%=%.gz)
84
70 xsltproc := xsltproc 85 xsltproc := xsltproc
71 xsltproc-opts := --nonet --xinclude --path '$(xml-path)' 86 xsltproc-opts := --nonet --xinclude --path '$(xml-path)'
72 87
73 xmllint := xmllint 88 xmllint := xmllint
74 xmllint-opts := --noout --nonet --valid 89 xmllint-opts := --noout --nonet --valid
107 hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n') 122 hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n')
108 123
109 hg-version = $(shell hg version -q | \ 124 hg-version = $(shell hg version -q | \
110 sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,') 125 sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,')
111 126
112 all: html 127 all: web
113 128
114 ../xsl/system-xsl: $(system-xsl-dir) 129 ../xsl/system-xsl: $(system-xsl-dir)
115 ln -s $< $@ 130 ln -s $< $@
116 131
132 web: websup html
133
117 html: ../xsl/system-xsl $(xml-src-files) valid 134 html: ../xsl/system-xsl $(xml-src-files) valid
118 xsltproc $(xsltproc-opts) -o html/x ../xsl/chunk-stylesheet.xsl 00book.xml 135 xsltproc $(xsltproc-opts) -o html/read/x ../xsl/chunk-stylesheet.xsl 00book.xml
136 for i in html/read/*.html; do \
137 gzip -9 -c $$i > $$i.gz; \
138 done
139
140 websup: $(extras-web)
141 mkdir -p $(obj-websup)/figs
142 cp ../xsl/system-xsl/images/*.png $(obj-websup)/figs
143 cp -f ../web/icons/*.png $(obj-websup)/figs
144
145 web: websup
119 146
120 valid: .validated-00book.xml 147 valid: .validated-00book.xml
121 148
122 .validated-00book.xml: $(xml-src-files) 149 .validated-00book.xml: $(xml-src-files)
123 $(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $< 150 $(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $<
151 cp html/*.{css,html,png} dist 178 cp html/*.{css,html,png} dist
152 cp $(dist-sources) dist 179 cp $(dist-sources) dist
153 180
154 rsync: install 181 rsync: install
155 rsync -avz --delete dist sp.red-bean.com:public_html/hgbook 182 rsync -avz --delete dist sp.red-bean.com:public_html/hgbook
183
184 vpath %.css ../web
185 vpath %.js ../web/javascript
186
187 $(obj-websup)/%.css: %.css
188 @mkdir -p $(dir $@)
189 cp $< $@
190
191 $(obj-websup)/%.jpg: %.jpg
192 @mkdir -p $(dir $@)
193 cp $< $@
194
195 $(obj-websup)/%.js: %.js
196 @mkdir -p $(dir $@)
197 cp $< $@
198
199 $(obj-web)/%: ../web/%
200 @mkdir -p $(dir $@)
201 cp $< $@
202
203 $(obj-web)/%.html: %.html.in
204 @mkdir -p $(dir $@)
205 python ../web/texpand.py $< $@
206
207 %.gz: %
208 gzip -9 -c $< > $@