Mercurial > hgbook
changeset 670:3bcc001ce34f
Get rid of lots of TeX-era cruft.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 09 Mar 2009 23:37:19 -0700 |
parents | 75f4a7a9170b |
children | 13513d2a128d |
files | en/Makefile |
diffstat | 1 files changed, 8 insertions(+), 92 deletions(-) [+] |
line wrap: on
line diff
--- a/en/Makefile Mon Mar 09 23:32:59 2009 -0700 +++ b/en/Makefile Mon Mar 09 23:37:19 2009 -0700 @@ -33,7 +33,6 @@ image-svg := $(filter %.svg,$(image-sources)) image-png := $(filter %.png,$(image-sources)) -image-pdf := $(image-dot:%.dot=%.pdf) $(image-svg:%.svg=%.pdf) $(image-png) image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png) example-sources := \ @@ -103,11 +102,6 @@ ../html/index.html.var \ ../html/index.en.html -latex-options = \ - -interaction batchmode \ - -output-directory $(dir $(1)) \ - -jobname $(basename $(notdir $(1))) - hg = $(shell which hg) hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n') @@ -115,31 +109,13 @@ hg-version = $(shell hg version -q | \ sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,') -all: pdf html - -pdf: pdf/hgbook.pdf - -define pdf - mkdir -p $(dir $@) - TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) - cp 99book.bib $(dir $@) - cd $(dir $@) && bibtex $(basename $(notdir $@)) - cd $(dir $@) && makeindex $(basename $(notdir $@)) - TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) - TEXINPUTS=$(dir $<): pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) - if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi -endef - -pdf/hgbook.pdf: $(sources) examples $(image-pdf) - $(call pdf) - -html: onepage split +all: html ../xsl/system-xsl: $(system-xsl-dir) ln -s $< $@ -dbhtml: ../xsl/system-xsl $(xml-src-files) valid - xsltproc $(xsltproc-opts) ../xsl/chunk-stylesheet.xsl 00book.xml +html: ../xsl/system-xsl $(xml-src-files) valid + xsltproc $(xsltproc-opts) -o html/x ../xsl/chunk-stylesheet.xsl 00book.xml valid: .validated-00book.xml @@ -147,37 +123,6 @@ $(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $< touch $@ -onepage: $(htlatex) html/onepage/hgbook.html html/onepage/hgbook.css $(image-html:%=html/onepage/%) - -html/onepage/%: % - cp $< $@ - -split: $(htlatex) html/split/hgbook.html html/split/hgbook.css $(image-html:%=html/split/%) - -html/split/%: % - cp $< $@ - -# This is a horrible hack to work around the fact that the htlatex -# command in tex4ht is itself a horrible hack. I really don't want to -# include verbatim the big wad of TeX that is repeated in that script, -# but I've given up and run a hacked copy as htlatex.book here. - -define htlatex - mkdir -p $(dir $(1)) - cp 99book.bib $(dir $(1)) - TEXINPUTS=$(dir $(2)): ./htlatex.book $(2) "bookhtml,html4-uni,$(3)" " -cunihtf -utf8" "$(dir $(1))" "$(call latex-options,$(1))" || (rm -f $(1); exit 1) - cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf - cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) - ./fixhtml.py $(dir $(1))/*.html - rm $(dir $(1))/hgbook.css -endef - -html/onepage/hgbook.html: $(sources) examples $(image-html) bookhtml.cfg - $(call htlatex,$@,$<) - -html/split/hgbook.html: $(sources) examples bookhtml.cfg - $(call htlatex,$@,$<,2) - # Produce 90dpi PNGs for the web. %.png: %.svg fixsvg @@ -188,19 +133,6 @@ %.svg: %.dot dot -Tsvg -o $@ $< -# Produce eps & pdf for the pdf - -%.pdf: %.eps - epstopdf $< - -%.eps: %.svg - ./fixsvg $< - inkscape -E $@ $<-tmp.svg - rm $<-tmp.svg - -%.eps: %.dot - dot -Tps -o $@ $< - examples: $(example-prereqs) examples/.run examples/.run: $(example-sources:%=examples/%.run) @@ -209,30 +141,14 @@ examples/%.run: examples/% examples/run-example cd examples && ./run-example $(notdir $<) -changelog := $(wildcard ../.hg/store/00changelog.[id]) -ifeq ($(changelog),) -changelog := $(wildcard ../.hg/00changelog.[id]) -endif - -build_id.tex: $(changelog) - echo -n '$(hg-id)' > build_id.tex +clean: + -rm -rf dist html $(image-dot:%.dot=%.pdf) $(image-dot:%.dot=%.png) \ + $(image-svg:%.svg=%.png) examples/*.{lxo,run} examples/.run -hg_id.tex: $(hg) - echo -n '$(hg-version)' > hg_id.tex - -clean: - rm -rf dist html pdf \ - $(image-dot:%.dot=%.pdf) \ - $(image-dot:%.dot=%.png) \ - $(image-svg:%.svg=%.pdf) \ - $(image-svg:%.svg=%.png) \ - examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex - -install: pdf split $(dist-sources) +install: html $(dist-sources) rm -rf dist mkdir -p dist - cp pdf/hgbook.pdf dist - cp html/split/*.{css,html,png} dist + cp html/*.{css,html,png} dist cp $(dist-sources) dist rsync: install