hgbook

diff en/Makefile @ 657:1e020cb7d417

Remove tools
author Dongsheng Song <songdongsheng@live.cn>
date Mon Mar 30 21:36:31 2009 +0800 (2009-03-30)
parents 7e7c47481e4f 9e8e5292acaa
children 3b33dd6aba87
line diff
     1.1 --- a/en/Makefile	Fri Mar 20 16:43:35 2009 +0800
     1.2 +++ b/en/Makefile	Mon Mar 30 21:36:31 2009 +0800
     1.3 @@ -1,28 +1,6 @@
     1.4  # This makefile requires GNU make.
     1.5  
     1.6 -image-sources := \
     1.7 -	feature-branches.dot \
     1.8 -	filelog.svg \
     1.9 -	kdiff3.png \
    1.10 -	metadata.svg \
    1.11 -	mq-stack.svg \
    1.12 -	note.png \
    1.13 -	revlog.svg \
    1.14 -	snapshot.svg \
    1.15 -	tour-history.svg \
    1.16 -	tour-merge-conflict.svg \
    1.17 -	tour-merge-merge.svg \
    1.18 -	tour-merge-pull.svg \
    1.19 -	tour-merge-sep-repos.svg \
    1.20 -	undo-manual.dot \
    1.21 -	undo-manual-merge.dot \
    1.22 -	undo-non-tip.dot \
    1.23 -	undo-simple.dot \
    1.24 -	wdir.svg \
    1.25 -	wdir-after-commit.svg \
    1.26 -	wdir-branch.svg \
    1.27 -	wdir-merge.svg \
    1.28 -	wdir-pre-branch.svg
    1.29 +image-sources := $(wildcard figs/*.dot figs/*.gif figs/*.png figs/*.svg)
    1.30  
    1.31  xml-src-files := \
    1.32  	00book.xml \
    1.33 @@ -31,9 +9,16 @@
    1.34  
    1.35  image-dot := $(filter %.dot,$(image-sources))
    1.36  image-svg := $(filter %.svg,$(image-sources))
    1.37 -image-png := $(filter %.png,$(image-sources))
    1.38 -
    1.39 -image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png)
    1.40 +image-oth := $(filter %.gif %.png,$(image-sources))
    1.41 +
    1.42 +obj-web := html
    1.43 +obj-websup := $(obj-web)/support
    1.44 +obj-web-read := $(obj-web)/read
    1.45 +
    1.46 +image-web := \
    1.47 +	$(image-dot:%.dot=$(obj-web-read)/%.png) \
    1.48 +	$(image-svg:%.svg=$(obj-web-read)/%.png) \
    1.49 +	$(image-oth:%=$(obj-web-read)/%)
    1.50  
    1.51  example-sources-by-name := \
    1.52  	backout \
    1.53 @@ -71,9 +56,6 @@
    1.54  	$(example-sources-by-name:%=examples/%) \
    1.55  	$(wildcard examples/ch*/*)
    1.56  
    1.57 -obj-web := html
    1.58 -obj-websup := html/support
    1.59 -
    1.60  extras-web-base := \
    1.61  	$(obj-web)/index.html \
    1.62  	$(obj-web)/robots.txt \
    1.63 @@ -130,24 +112,30 @@
    1.64  
    1.65  all: web
    1.66  
    1.67 -../xsl/system-xsl: $(system-xsl-dir)
    1.68 +../stylesheets/system-xsl: $(system-xsl-dir)
    1.69  	ln -s $< $@
    1.70  
    1.71 -web: ../xsl/system-xsl websup html
    1.72 -
    1.73 -html: ../xsl/system-xsl $(xml-src-files) valid
    1.74 -	xsltproc $(xsltproc-opts) -o html/read/x ../xsl/chunk-stylesheet.xsl 00book.xml
    1.75 -	for i in html/read/*.html; do \
    1.76 +web: ../stylesheets/system-xsl websup html
    1.77 +
    1.78 +html: $(obj-web-read)/index.html
    1.79 +
    1.80 +../web/index-read.html.in: ../web/genindex.py $(xml-src-files)
    1.81 +	$<
    1.82 +
    1.83 +$(obj-web-read)/index.html: ../stylesheets/system-xsl .validated-00book.xml ../web/index-read.html.in
    1.84 +	xsltproc $(xsltproc-opts) -o $(obj-web-read)/x ../stylesheets/chunk-stylesheet.xsl 00book.xml
    1.85 +	python ../web/texpand.py ../web/index-read.html.in html/read/index.html
    1.86 +	for i in $(obj-web-read)/*.html; do \
    1.87  	  gzip -9 -c $$i > $$i.gz; \
    1.88  	done
    1.89  
    1.90 -websup: $(extras-web)
    1.91 -	mkdir -p $(obj-websup)/figs
    1.92 -	cp ../xsl/system-xsl/images/*.png $(obj-websup)/figs
    1.93 +websup: $(extras-web) $(image-web)
    1.94 +	mkdir -p $(obj-websup)/figs $(obj-web-read)/figs
    1.95 +	cp ../stylesheets/system-xsl/images/*.png $(obj-websup)/figs
    1.96  	cp -f ../web/icons/*.png $(obj-websup)/figs
    1.97  
    1.98 -all-ids.dat: ../xsl/all-ids.xsl $(xml-src-files)
    1.99 -	$(xsltproc) $(xsltproc-opts) -o $@ ../xsl/all-ids.xsl 00book.xml
   1.100 +all-ids.dat: ../stylesheets/all-ids.xsl $(xml-src-files)
   1.101 +	$(xsltproc) $(xsltproc-opts) -o $@ ../stylesheets/all-ids.xsl 00book.xml
   1.102  
   1.103  web: websup
   1.104  
   1.105 @@ -159,12 +147,26 @@
   1.106  
   1.107  # Produce 90dpi PNGs for the web.
   1.108  
   1.109 -%.png: %.svg fixsvg
   1.110 +$(obj-web-read)/figs/%.png: $(obj-web-read)/figs/%.svg fixsvg
   1.111 +	mkdir -p $(dir $@)
   1.112  	./fixsvg $<
   1.113  	inkscape -D -e $@ $<-tmp.svg
   1.114  	rm $<-tmp.svg
   1.115  
   1.116 -%.svg: %.dot
   1.117 +$(obj-web-read)/figs/%.png: figs/%.svg fixsvg
   1.118 +	mkdir -p $(dir $@)
   1.119 +	./fixsvg $<
   1.120 +	inkscape -D -e $@ $<-tmp.svg
   1.121 +	rm $<-tmp.svg
   1.122 +
   1.123 +$(obj-web-read)/figs/%.gif: figs/%.gif
   1.124 +	cp $< $@
   1.125 +
   1.126 +$(obj-web-read)/figs/%.png: figs/%.png
   1.127 +	cp $< $@
   1.128 +
   1.129 +$(obj-web-read)/figs/%.svg: figs/%.dot
   1.130 +	mkdir -p $(dir $@)
   1.131  	dot -Tsvg -o $@ $<
   1.132  
   1.133  examples: $(example-prereqs) examples/.run
   1.134 @@ -188,6 +190,7 @@
   1.135  	rsync -avz --delete dist sp.red-bean.com:public_html/hgbook
   1.136  
   1.137  vpath %.css ../web
   1.138 +vpath %.html.in ../web
   1.139  vpath %.js ../web/javascript
   1.140  
   1.141  $(obj-websup)/%.css: %.css