hgbook

diff Makefile @ 654:1c13ed2130a7

Merge with http://hg.serpentine.com/mercurial/book
author Dongsheng Song <dongsheng.song@gmail.com>
date Mon Mar 30 16:23:33 2009 +0800 (2009-03-30)
parents 74da9b315396
children 1e020cb7d417
line diff
     1.1 --- a/Makefile	Fri Mar 13 15:55:43 2009 +0800
     1.2 +++ b/Makefile	Mon Mar 30 16:23:33 2009 +0800
     1.3 @@ -20,26 +20,26 @@
     1.4  rev_id = $(shell hg parents --template '{node|short} ({date|shortdate})')
     1.5  
     1.6  images := \
     1.7 -	en/images/feature-branches.png \
     1.8 -	en/images/filelog.png \
     1.9 -	en/images/metadata.png \
    1.10 -	en/images/mq-stack.png \
    1.11 -	en/images/revlog.png \
    1.12 -	en/images/snapshot.png \
    1.13 -	en/images/tour-history.png \
    1.14 -	en/images/tour-merge-conflict.png \
    1.15 -	en/images/tour-merge-merge.png \
    1.16 -	en/images/tour-merge-pull.png \
    1.17 -	en/images/tour-merge-sep-repos.png \
    1.18 -	en/images/undo-manual-merge.png \
    1.19 -	en/images/undo-manual.png \
    1.20 -	en/images/undo-non-tip.png \
    1.21 -	en/images/undo-simple.png \
    1.22 -	en/images/wdir-after-commit.png \
    1.23 -	en/images/wdir-branch.png \
    1.24 -	en/images/wdir-merge.png \
    1.25 -	en/images/wdir.png \
    1.26 -	en/images/wdir-pre-branch.png
    1.27 +	en/figs/feature-branches.png \
    1.28 +	en/figs/filelog.png \
    1.29 +	en/figs/metadata.png \
    1.30 +	en/figs/mq-stack.png \
    1.31 +	en/figs/revlog.png \
    1.32 +	en/figs/snapshot.png \
    1.33 +	en/figs/tour-history.png \
    1.34 +	en/figs/tour-merge-conflict.png \
    1.35 +	en/figs/tour-merge-merge.png \
    1.36 +	en/figs/tour-merge-pull.png \
    1.37 +	en/figs/tour-merge-sep-repos.png \
    1.38 +	en/figs/undo-manual-merge.png \
    1.39 +	en/figs/undo-manual.png \
    1.40 +	en/figs/undo-non-tip.png \
    1.41 +	en/figs/undo-simple.png \
    1.42 +	en/figs/wdir-after-commit.png \
    1.43 +	en/figs/wdir-branch.png \
    1.44 +	en/figs/wdir-merge.png \
    1.45 +	en/figs/wdir.png \
    1.46 +	en/figs/wdir-pre-branch.png
    1.47  
    1.48  help:
    1.49  	@echo "  make html         [LINGUA=en|zh|...]"
    1.50 @@ -53,30 +53,30 @@
    1.51  	@echo "  make clean        # Remove the build files."
    1.52  
    1.53  clean:
    1.54 -	@rm -fr build po/*.mo hello en/hello en/html en/.validated-00book.xml \
    1.55 -          stylesheets/system-xsl en/images/*-tmp.svg \
    1.56 -          en/images/feature-branches.png \
    1.57 -          en/images/filelog.png \
    1.58 -          en/images/feature-branches.png \
    1.59 -          en/images/filelog.png \
    1.60 -          en/images/metadata.png \
    1.61 -          en/images/mq-stack.png \
    1.62 -          en/images/revlog.png \
    1.63 -          en/images/snapshot.png \
    1.64 -          en/images/tour-history.png \
    1.65 -          en/images/tour-merge-conflict.png \
    1.66 -          en/images/tour-merge-merge.png \
    1.67 -          en/images/tour-merge-pull.png \
    1.68 -          en/images/tour-merge-sep-repos.png \
    1.69 -          en/images/undo-manual-merge.png \
    1.70 -          en/images/undo-manual.png \
    1.71 -          en/images/undo-non-tip.png \
    1.72 -          en/images/undo-simple.png \
    1.73 -          en/images/wdir-after-commit.png \
    1.74 -          en/images/wdir-branch.png \
    1.75 -          en/images/wdir-merge.png \
    1.76 -          en/images/wdir-pre-branch.png \
    1.77 -          en/images/wdir.png
    1.78 +	@rm -fr build po/*.mo hello en/hello en/html en/.validated-00book.xml en/examples/.run en/examples/results \
    1.79 +          stylesheets/system-xsl en/figs/*-tmp.svg \
    1.80 +          en/figs/feature-branches.png \
    1.81 +          en/figs/filelog.png \
    1.82 +          en/figs/feature-branches.png \
    1.83 +          en/figs/filelog.png \
    1.84 +          en/figs/metadata.png \
    1.85 +          en/figs/mq-stack.png \
    1.86 +          en/figs/revlog.png \
    1.87 +          en/figs/snapshot.png \
    1.88 +          en/figs/tour-history.png \
    1.89 +          en/figs/tour-merge-conflict.png \
    1.90 +          en/figs/tour-merge-merge.png \
    1.91 +          en/figs/tour-merge-pull.png \
    1.92 +          en/figs/tour-merge-sep-repos.png \
    1.93 +          en/figs/undo-manual-merge.png \
    1.94 +          en/figs/undo-manual.png \
    1.95 +          en/figs/undo-non-tip.png \
    1.96 +          en/figs/undo-simple.png \
    1.97 +          en/figs/wdir-after-commit.png \
    1.98 +          en/figs/wdir-branch.png \
    1.99 +          en/figs/wdir-merge.png \
   1.100 +          en/figs/wdir-pre-branch.png \
   1.101 +          en/figs/wdir.png
   1.102  
   1.103  all:
   1.104  ifdef LINGUA
   1.105 @@ -133,23 +133,24 @@
   1.106  	xmllint --nonet --noout --postvalid --xinclude $<
   1.107  
   1.108  ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" ""
   1.109 -build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(images)
   1.110 -	mkdir -p build/$(LINGUA)/source
   1.111 -	cp -r $(LINGUA)/* build/$(LINGUA)/source
   1.112 -	xmllint --nonet --noent --xinclude --postvalid --output $@.tmp $(LINGUA)/00book.xml
   1.113 +$(LINGUA)/examples/.run:
   1.114 +	(cd $(LINGUA)/examples; ./run-example -v -a)
   1.115 +
   1.116 +build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(images) $(LINGUA)/examples/.run $(images)
   1.117 +	mkdir -p build/$(LINGUA)/source/figs
   1.118 +	cp $(LINGUA)/figs/*.png build/$(LINGUA)/source/figs
   1.119 +	(cd $(LINGUA); xmllint --nonet --noent --xinclude --postvalid --output ../$@.tmp 00book.xml)
   1.120  	cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
   1.121  else
   1.122 -build/$(LINGUA)/source/hgbook.xml: $(wildcard en/*.xml) po/$(LINGUA).po $(images)
   1.123 -	mkdir -p build/$(LINGUA)/source
   1.124 -	cp -r en/images build/$(LINGUA)/source
   1.125 -	cp -r en/examples build/$(LINGUA)/source
   1.126 -	cp en/book-shortcuts.xml build/$(LINGUA)/source
   1.127 -	for f in en/*.xml; do \
   1.128 -	  if [ $$f != "en/book-shortcuts.xml" ]; then \
   1.129 -	    $(TRANSLATE) -m $$f -p po/$(LINGUA).po -l build/$(LINGUA)/source/`basename $$f`; \
   1.130 -	  fi \
   1.131 -	done
   1.132 -	xmllint --nonet --noent --xinclude --postvalid --output $@.tmp build/$(LINGUA)/source/00book.xml
   1.133 +en/examples/.run:
   1.134 +	(cd en/examples; ./run-example -v -a)
   1.135 +
   1.136 +build/en/source/hgbook.xml:
   1.137 +	${MAKE} LINGUA=en $@
   1.138 +
   1.139 +build/$(LINGUA)/source/hgbook.xml: build/en/source/hgbook.xml po/$(LINGUA).po $(images)
   1.140 +	mkdir -p build/$(LINGUA)/source/figs
   1.141 +	$(TRANSLATE) -m build/en/source/hgbook.xml -p po/$(LINGUA).po -l $@.tmp
   1.142  	cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
   1.143  endif
   1.144  
   1.145 @@ -164,8 +165,8 @@
   1.146  html: build/$(LINGUA)/html/index.html
   1.147  
   1.148  build/$(LINGUA)/html/index.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html.xsl stylesheets/$(LINGUA)/html.xsl
   1.149 -	mkdir -p build/$(LINGUA)/html/images
   1.150 -	cp en/images/*.png build/$(LINGUA)/html/images
   1.151 +	mkdir -p build/$(LINGUA)/html/figs
   1.152 +	cp en/figs/*.png build/$(LINGUA)/html/figs
   1.153  	cp stylesheets/hgbook.css build/$(LINGUA)/html
   1.154  	xsltproc --output build/$(LINGUA)/html/ \
   1.155  	    stylesheets/$(LINGUA)/html.xsl build/$(LINGUA)/source/hgbook.xml
   1.156 @@ -180,8 +181,8 @@
   1.157  html-single: build/$(LINGUA)/html-single/hgbook.html
   1.158  
   1.159  build/$(LINGUA)/html-single/hgbook.html: build/$(LINGUA)/source/hgbook.xml stylesheets/html-single.xsl stylesheets/$(LINGUA)/html-single.xsl
   1.160 -	mkdir -p build/$(LINGUA)/html-single/images
   1.161 -	cp en/images/*.png build/$(LINGUA)/html-single/images
   1.162 +	mkdir -p build/$(LINGUA)/html-single/figs
   1.163 +	cp en/figs/*.png build/$(LINGUA)/html-single/figs
   1.164  	cp stylesheets/hgbook.css build/$(LINGUA)/html-single
   1.165  	xsltproc --output build/$(LINGUA)/html-single/hgbook.html \
   1.166  	    stylesheets/$(LINGUA)/html-single.xsl build/$(LINGUA)/source/hgbook.xml
   1.167 @@ -210,9 +211,9 @@
   1.168  	(cd build/$(LINGUA)/source && ../../../tools/fop/fop.sh hgbook.fo ../pdf/hgbook.pdf)
   1.169  endif
   1.170  
   1.171 -en/images/%.png: en/images/%.svg en/fixsvg
   1.172 +en/figs/%.png: en/figs/%.svg en/fixsvg
   1.173  	en/fixsvg $<
   1.174  	inkscape -D -d 120 -e $@ $<-tmp.svg
   1.175  
   1.176 -en/images/%.svg: en/images/%.dot
   1.177 +en/figs/%.svg: en/figs/%.dot
   1.178  	dot -Tsvg -o $@ $<