hgbook
diff es/Makefile @ 323:701cc7f8aee3
Initial guidelines for translation
author | Igor TAmara <igor@tamarapatino.org> |
---|---|
date | Fri Oct 17 04:21:35 2008 -0500 (2008-10-17) |
parents | |
children | bd0c83293048 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/es/Makefile Fri Oct 17 04:21:35 2008 -0500 1.3 @@ -0,0 +1,220 @@ 1.4 +# This makefile requires GNU make. 1.5 + 1.6 +sources := \ 1.7 + 00book.tex \ 1.8 + 99book.bib \ 1.9 + 99defs.tex \ 1.10 + build_id.tex \ 1.11 + branch.tex \ 1.12 + cmdref.tex \ 1.13 + collab.tex \ 1.14 + concepts.tex \ 1.15 + daily.tex \ 1.16 + filenames.tex \ 1.17 + hg_id.tex \ 1.18 + hgext.tex \ 1.19 + hook.tex \ 1.20 + intro.tex \ 1.21 + mq.tex \ 1.22 + mq-collab.tex \ 1.23 + mq-ref.tex \ 1.24 + preface.tex \ 1.25 + srcinstall.tex \ 1.26 + template.tex \ 1.27 + tour-basic.tex \ 1.28 + tour-merge.tex \ 1.29 + undo.tex 1.30 + 1.31 +image-sources := \ 1.32 + feature-branches.dot \ 1.33 + filelog.svg \ 1.34 + kdiff3.png \ 1.35 + metadata.svg \ 1.36 + mq-stack.svg \ 1.37 + note.png \ 1.38 + revlog.svg \ 1.39 + snapshot.svg \ 1.40 + tour-history.svg \ 1.41 + tour-merge-conflict.svg \ 1.42 + tour-merge-merge.svg \ 1.43 + tour-merge-pull.svg \ 1.44 + tour-merge-sep-repos.svg \ 1.45 + undo-manual.dot \ 1.46 + undo-manual-merge.dot \ 1.47 + undo-non-tip.dot \ 1.48 + undo-simple.dot \ 1.49 + wdir.svg \ 1.50 + wdir-after-commit.svg \ 1.51 + wdir-branch.svg \ 1.52 + wdir-merge.svg \ 1.53 + wdir-pre-branch.svg 1.54 + 1.55 +image-dot := $(filter %.dot,$(image-sources)) 1.56 +image-svg := $(filter %.svg,$(image-sources)) 1.57 +image-png := $(filter %.png,$(image-sources)) 1.58 + 1.59 +image-pdf := $(image-dot:%.dot=%.pdf) $(image-svg:%.svg=%.pdf) $(image-png) 1.60 +image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png) 1.61 + 1.62 +example-sources := \ 1.63 + backout \ 1.64 + bisect \ 1.65 + branching \ 1.66 + branch-named \ 1.67 + branch-repo \ 1.68 + cmdref \ 1.69 + daily.copy \ 1.70 + daily.files \ 1.71 + daily.rename \ 1.72 + daily.revert \ 1.73 + extdiff \ 1.74 + filenames \ 1.75 + hook.msglen \ 1.76 + hook.simple \ 1.77 + hook.ws \ 1.78 + issue29 \ 1.79 + mq.guards \ 1.80 + mq.qinit-help \ 1.81 + mq.dodiff \ 1.82 + mq.id \ 1.83 + mq.tarball \ 1.84 + mq.tools \ 1.85 + mq.tutorial \ 1.86 + rename.divergent \ 1.87 + rollback \ 1.88 + tag \ 1.89 + template.simple \ 1.90 + template.svnstyle \ 1.91 + tour \ 1.92 + tour-merge-conflict 1.93 + 1.94 +example-prereqs := \ 1.95 + /usr/bin/merge 1.96 + 1.97 +dist-sources := \ 1.98 + ../html/hgicon.png \ 1.99 + ../html/index.html.var \ 1.100 + ../html/index.en.html 1.101 + 1.102 +latex-options = \ 1.103 + -interaction batchmode \ 1.104 + -output-directory $(dir $(1)) \ 1.105 + -jobname $(basename $(notdir $(1))) 1.106 + 1.107 +hg = $(shell which hg) 1.108 + 1.109 +hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n') 1.110 + 1.111 +hg-version = $(shell hg version -q | \ 1.112 + sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,') 1.113 + 1.114 +all: pdf html 1.115 + 1.116 +pdf: pdf/hgbook.pdf 1.117 + 1.118 +define pdf 1.119 + mkdir -p $(dir $@) 1.120 + TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.121 + cp 99book.bib $(dir $@) 1.122 + cd $(dir $@) && bibtex $(basename $(notdir $@)) 1.123 + cd $(dir $@) && makeindex $(basename $(notdir $@)) 1.124 + TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.125 + TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.126 + if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi 1.127 +endef 1.128 + 1.129 +pdf/hgbook.pdf: $(sources) examples $(image-pdf) 1.130 + $(call pdf) 1.131 + 1.132 +html: onepage split 1.133 + 1.134 +onepage: $(htlatex) html/onepage/hgbook.html html/onepage/hgbook.css $(image-html:%=html/onepage/%) 1.135 + 1.136 +html/onepage/%: % 1.137 + cp $< $@ 1.138 + 1.139 +split: $(htlatex) html/split/hgbook.html html/split/hgbook.css $(image-html:%=html/split/%) 1.140 + 1.141 +html/split/%: % 1.142 + cp $< $@ 1.143 + 1.144 +# This is a horrible hack to work around the fact that the htlatex 1.145 +# command in tex4ht is itself a horrible hack. I really don't want to 1.146 +# include verbatim the big wad of TeX that is repeated in that script, 1.147 +# but I've given up and run a hacked copy as htlatex.book here. 1.148 + 1.149 +define htlatex 1.150 + mkdir -p $(dir $(1)) 1.151 + cp 99book.bib $(dir $(1)) 1.152 + TEXINPUTS=$(dir $(2)): ./htlatex.book $(2) "bookhtml,html4-uni,$(3)" " -cunihtf -utf8" "$(dir $(1))" "$(call latex-options,$(1))" || (rm -f $(1); exit 1) 1.153 + cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf 1.154 + cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) 1.155 + ./fixhtml.py $(dir $(1))/*.html 1.156 + rm $(dir $(1))/hgbook.css 1.157 +endef 1.158 + 1.159 +html/onepage/hgbook.html: $(sources) examples $(image-html) bookhtml.cfg 1.160 + $(call htlatex,$@,$<) 1.161 + 1.162 +html/split/hgbook.html: $(sources) examples bookhtml.cfg 1.163 + $(call htlatex,$@,$<,2) 1.164 + 1.165 +# Produce 90dpi PNGs for the web. 1.166 + 1.167 +%.png: %.svg fixsvg 1.168 + ./fixsvg $< 1.169 + inkscape -D -e $@ $<-tmp.svg 1.170 + rm $<-tmp.svg 1.171 + 1.172 +%.svg: %.dot 1.173 + dot -Tsvg -o $@ $< 1.174 + 1.175 +# Produce eps & pdf for the pdf 1.176 + 1.177 +%.pdf: %.eps 1.178 + epstopdf $< 1.179 + 1.180 +%.eps: %.svg 1.181 + ./fixsvg $< 1.182 + inkscape -E $@ $<-tmp.svg 1.183 + rm $<-tmp.svg 1.184 + 1.185 +%.eps: %.dot 1.186 + dot -Tps -o $@ $< 1.187 + 1.188 +examples: $(example-prereqs) examples/.run 1.189 + 1.190 +examples/.run: $(example-sources:%=examples/%.run) 1.191 + touch examples/.run 1.192 + 1.193 +examples/%.run: examples/% examples/run-example 1.194 + cd examples && ./run-example $(notdir $<) 1.195 + 1.196 +changelog := $(wildcard ../.hg/store/00changelog.[id]) 1.197 +ifeq ($(changelog),) 1.198 +changelog := $(wildcard ../.hg/00changelog.[id]) 1.199 +endif 1.200 + 1.201 +build_id.tex: $(changelog) 1.202 + echo -n '$(hg-id)' > build_id.tex 1.203 + 1.204 +hg_id.tex: $(hg) 1.205 + echo -n '$(hg-version)' > hg_id.tex 1.206 + 1.207 +clean: 1.208 + rm -rf dist html pdf \ 1.209 + $(image-dot:%.dot=%.pdf) \ 1.210 + $(image-dot:%.dot=%.png) \ 1.211 + $(image-svg:%.svg=%.pdf) \ 1.212 + $(image-svg:%.svg=%.png) \ 1.213 + examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex 1.214 + 1.215 +install: pdf split $(dist-sources) 1.216 + rm -rf dist 1.217 + mkdir -p dist 1.218 + cp pdf/hgbook.pdf dist 1.219 + cp html/split/*.{css,html,png} dist 1.220 + cp $(dist-sources) dist 1.221 + 1.222 +rsync: install 1.223 + rsync -avz --delete dist sp.red-bean.com:public_html/hgbook