hgbook
changeset 571:3bcc001ce34f
Get rid of lots of TeX-era cruft.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon Mar 09 23:37:19 2009 -0700 (2009-03-09) |
parents | 75f4a7a9170b |
children | 13513d2a128d |
files | en/Makefile |
line diff
1.1 --- a/en/Makefile Mon Mar 09 23:32:59 2009 -0700 1.2 +++ b/en/Makefile Mon Mar 09 23:37:19 2009 -0700 1.3 @@ -33,7 +33,6 @@ 1.4 image-svg := $(filter %.svg,$(image-sources)) 1.5 image-png := $(filter %.png,$(image-sources)) 1.6 1.7 -image-pdf := $(image-dot:%.dot=%.pdf) $(image-svg:%.svg=%.pdf) $(image-png) 1.8 image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png) 1.9 1.10 example-sources := \ 1.11 @@ -103,11 +102,6 @@ 1.12 ../html/index.html.var \ 1.13 ../html/index.en.html 1.14 1.15 -latex-options = \ 1.16 - -interaction batchmode \ 1.17 - -output-directory $(dir $(1)) \ 1.18 - -jobname $(basename $(notdir $(1))) 1.19 - 1.20 hg = $(shell which hg) 1.21 1.22 hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n') 1.23 @@ -115,31 +109,13 @@ 1.24 hg-version = $(shell hg version -q | \ 1.25 sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,') 1.26 1.27 -all: pdf html 1.28 - 1.29 -pdf: pdf/hgbook.pdf 1.30 - 1.31 -define pdf 1.32 - mkdir -p $(dir $@) 1.33 - TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.34 - cp 99book.bib $(dir $@) 1.35 - cd $(dir $@) && bibtex $(basename $(notdir $@)) 1.36 - cd $(dir $@) && makeindex $(basename $(notdir $@)) 1.37 - TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.38 - TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.39 - if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi 1.40 -endef 1.41 - 1.42 -pdf/hgbook.pdf: $(sources) examples $(image-pdf) 1.43 - $(call pdf) 1.44 - 1.45 -html: onepage split 1.46 +all: html 1.47 1.48 ../xsl/system-xsl: $(system-xsl-dir) 1.49 ln -s $< $@ 1.50 1.51 -dbhtml: ../xsl/system-xsl $(xml-src-files) valid 1.52 - xsltproc $(xsltproc-opts) ../xsl/chunk-stylesheet.xsl 00book.xml 1.53 +html: ../xsl/system-xsl $(xml-src-files) valid 1.54 + xsltproc $(xsltproc-opts) -o html/x ../xsl/chunk-stylesheet.xsl 00book.xml 1.55 1.56 valid: .validated-00book.xml 1.57 1.58 @@ -147,37 +123,6 @@ 1.59 $(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $< 1.60 touch $@ 1.61 1.62 -onepage: $(htlatex) html/onepage/hgbook.html html/onepage/hgbook.css $(image-html:%=html/onepage/%) 1.63 - 1.64 -html/onepage/%: % 1.65 - cp $< $@ 1.66 - 1.67 -split: $(htlatex) html/split/hgbook.html html/split/hgbook.css $(image-html:%=html/split/%) 1.68 - 1.69 -html/split/%: % 1.70 - cp $< $@ 1.71 - 1.72 -# This is a horrible hack to work around the fact that the htlatex 1.73 -# command in tex4ht is itself a horrible hack. I really don't want to 1.74 -# include verbatim the big wad of TeX that is repeated in that script, 1.75 -# but I've given up and run a hacked copy as htlatex.book here. 1.76 - 1.77 -define htlatex 1.78 - mkdir -p $(dir $(1)) 1.79 - cp 99book.bib $(dir $(1)) 1.80 - TEXINPUTS=$(dir $(2)): ./htlatex.book $(2) "bookhtml,html4-uni,$(3)" " -cunihtf -utf8" "$(dir $(1))" "$(call latex-options,$(1))" || (rm -f $(1); exit 1) 1.81 - cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf 1.82 - cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) 1.83 - ./fixhtml.py $(dir $(1))/*.html 1.84 - rm $(dir $(1))/hgbook.css 1.85 -endef 1.86 - 1.87 -html/onepage/hgbook.html: $(sources) examples $(image-html) bookhtml.cfg 1.88 - $(call htlatex,$@,$<) 1.89 - 1.90 -html/split/hgbook.html: $(sources) examples bookhtml.cfg 1.91 - $(call htlatex,$@,$<,2) 1.92 - 1.93 # Produce 90dpi PNGs for the web. 1.94 1.95 %.png: %.svg fixsvg 1.96 @@ -188,19 +133,6 @@ 1.97 %.svg: %.dot 1.98 dot -Tsvg -o $@ $< 1.99 1.100 -# Produce eps & pdf for the pdf 1.101 - 1.102 -%.pdf: %.eps 1.103 - epstopdf $< 1.104 - 1.105 -%.eps: %.svg 1.106 - ./fixsvg $< 1.107 - inkscape -E $@ $<-tmp.svg 1.108 - rm $<-tmp.svg 1.109 - 1.110 -%.eps: %.dot 1.111 - dot -Tps -o $@ $< 1.112 - 1.113 examples: $(example-prereqs) examples/.run 1.114 1.115 examples/.run: $(example-sources:%=examples/%.run) 1.116 @@ -209,30 +141,14 @@ 1.117 examples/%.run: examples/% examples/run-example 1.118 cd examples && ./run-example $(notdir $<) 1.119 1.120 -changelog := $(wildcard ../.hg/store/00changelog.[id]) 1.121 -ifeq ($(changelog),) 1.122 -changelog := $(wildcard ../.hg/00changelog.[id]) 1.123 -endif 1.124 +clean: 1.125 + -rm -rf dist html $(image-dot:%.dot=%.pdf) $(image-dot:%.dot=%.png) \ 1.126 + $(image-svg:%.svg=%.png) examples/*.{lxo,run} examples/.run 1.127 1.128 -build_id.tex: $(changelog) 1.129 - echo -n '$(hg-id)' > build_id.tex 1.130 - 1.131 -hg_id.tex: $(hg) 1.132 - echo -n '$(hg-version)' > hg_id.tex 1.133 - 1.134 -clean: 1.135 - rm -rf dist html pdf \ 1.136 - $(image-dot:%.dot=%.pdf) \ 1.137 - $(image-dot:%.dot=%.png) \ 1.138 - $(image-svg:%.svg=%.pdf) \ 1.139 - $(image-svg:%.svg=%.png) \ 1.140 - examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex 1.141 - 1.142 -install: pdf split $(dist-sources) 1.143 +install: html $(dist-sources) 1.144 rm -rf dist 1.145 mkdir -p dist 1.146 - cp pdf/hgbook.pdf dist 1.147 - cp html/split/*.{css,html,png} dist 1.148 + cp html/*.{css,html,png} dist 1.149 cp $(dist-sources) dist 1.150 1.151 rsync: install