hgbook

diff en/Makefile @ 623:082bb76417f1

Add Po4a 0.37-dev(2009-03-08)
author Dongsheng Song <dongsheng.song@gmail.com>
date Thu Mar 12 15:43:56 2009 +0800 (2009-03-12)
parents 3bcc001ce34f
children 8366882f67f2 1879ec732a28 c88aa4edf9df
line diff
     1.1 --- a/en/Makefile	Mon Mar 09 23:37:19 2009 -0700
     1.2 +++ b/en/Makefile	Thu Mar 12 15:43:56 2009 +0800
     1.3 @@ -67,6 +67,21 @@
     1.4  	tour \
     1.5  	tour-merge-conflict
     1.6  
     1.7 +obj-web := html
     1.8 +obj-websup := html/support
     1.9 +
    1.10 +extras-web-base := \
    1.11 +	$(obj-web)/index.html \
    1.12 +	$(obj-web)/robots.txt \
    1.13 +	$(obj-websup)/form-min.js \
    1.14 +	$(obj-websup)/form.js \
    1.15 +	$(obj-websup)/hsbook.js \
    1.16 +	$(obj-websup)/jquery-min.js \
    1.17 +	$(obj-websup)/jquery.js \
    1.18 +	$(obj-websup)/styles.css
    1.19 +
    1.20 +extras-web := $(extras-web-base) $(extras-web-base:%=%.gz)
    1.21 +
    1.22  xsltproc := xsltproc
    1.23  xsltproc-opts := --nonet --xinclude --path '$(xml-path)'
    1.24  
    1.25 @@ -109,13 +124,25 @@
    1.26  hg-version = $(shell hg version -q | \
    1.27  		     sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,')
    1.28  
    1.29 -all: html
    1.30 +all: web
    1.31  
    1.32  ../xsl/system-xsl: $(system-xsl-dir)
    1.33  	ln -s $< $@
    1.34  
    1.35 +web: websup html
    1.36 +
    1.37  html: ../xsl/system-xsl $(xml-src-files) valid
    1.38 -	xsltproc $(xsltproc-opts) -o html/x ../xsl/chunk-stylesheet.xsl 00book.xml
    1.39 +	xsltproc $(xsltproc-opts) -o html/read/x ../xsl/chunk-stylesheet.xsl 00book.xml
    1.40 +	for i in html/read/*.html; do \
    1.41 +	  gzip -9 -c $$i > $$i.gz; \
    1.42 +	done
    1.43 +
    1.44 +websup: $(extras-web)
    1.45 +	mkdir -p $(obj-websup)/figs
    1.46 +	cp ../xsl/system-xsl/images/*.png $(obj-websup)/figs
    1.47 +	cp -f ../web/icons/*.png $(obj-websup)/figs
    1.48 +
    1.49 +web: websup
    1.50  
    1.51  valid: .validated-00book.xml
    1.52  
    1.53 @@ -153,3 +180,29 @@
    1.54  
    1.55  rsync: install
    1.56  	rsync -avz --delete dist sp.red-bean.com:public_html/hgbook
    1.57 +
    1.58 +vpath %.css ../web
    1.59 +vpath %.js ../web/javascript
    1.60 +
    1.61 +$(obj-websup)/%.css: %.css
    1.62 +	@mkdir -p $(dir $@)
    1.63 +	cp $< $@
    1.64 +
    1.65 +$(obj-websup)/%.jpg: %.jpg
    1.66 +	@mkdir -p $(dir $@)
    1.67 +	cp $< $@
    1.68 +
    1.69 +$(obj-websup)/%.js: %.js
    1.70 +	@mkdir -p $(dir $@)
    1.71 +	cp $< $@
    1.72 +
    1.73 +$(obj-web)/%: ../web/%
    1.74 +	@mkdir -p $(dir $@)
    1.75 +	cp $< $@
    1.76 +
    1.77 +$(obj-web)/%.html: %.html.in
    1.78 +	@mkdir -p $(dir $@)
    1.79 +	python ../web/texpand.py $< $@
    1.80 +
    1.81 +%.gz: %
    1.82 +	gzip -9 -c $< > $@