hgbook

annotate en/Makefile @ 7:339e75288632

More progress on MQ chapter and general support.

Added a note environment.

Fixed generated HTML so it wouldn't use huge escaped entities for everything.

Wrote a small amount of actual content.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Jun 26 12:25:11 2006 -0700 (2006-06-26)
parents 33a2e7b9978d
children e9d5b4c3d16b
rev   line source
bos@2 1 sources := \
bos@2 2 00book.tex \
bos@2 3 99book.bib \
bos@2 4 99defs.tex \
bos@2 5 mq.tex
bos@0 6
bos@4 7 example-sources := \
bos@4 8 examples/run-example \
bos@7 9 examples/mq.qinit-help \
bos@7 10 examples/mq.tutorial
bos@4 11
bos@0 12 latex-options = \
bos@0 13 -interaction batchmode \
bos@0 14 -output-directory $(dir $(1)) \
bos@0 15 -jobname $(basename $(notdir $(1)))
bos@0 16
bos@0 17 all: pdf html
bos@0 18
bos@0 19 pdf: pdf/hgbook.pdf
bos@0 20
bos@4 21 pdf/hgbook.pdf: $(sources) examples
bos@0 22 mkdir -p $(dir $@)
bos@0 23 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@2 24 cp 99book.bib $(dir $@)
bos@2 25 cd $(dir $@) && bibtex $(basename $(notdir $@))
bos@0 26 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@0 27 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@0 28
bos@0 29 html: html/onepage/hgbook.html html/split/hgbook.html
bos@0 30
bos@0 31 define htlatex
bos@0 32 mkdir -p $(dir $(1))
bos@7 33 head -2 $(shell which htlatex) > $(dir $(1))/htlatex.book
bos@7 34 cp 99book.bib $(dir $@)
bos@7 35 echo '(cd $(dir $@) && bibtex $(basename $(notdir $@)))' >> $(dir $(1))/htlatex.book
bos@7 36 head -3 $(shell which htlatex) >> $(dir $(1))/htlatex.book
bos@7 37 echo 'echo status $$$$' >> $(dir $(1))/htlatex.book
bos@0 38 chmod 755 $(dir $(1))/htlatex.book
bos@0 39 $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
bos@0 40 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf
bos@0 41 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1)))
bos@7 42 perl -pi -e 's/&#x00([0-7][0-9a-f]);/chr(hex($$1))/egi' $(dir $(1))/*.html
bos@0 43 endef
bos@0 44
bos@4 45 html/onepage/hgbook.html: $(sources) examples
bos@0 46 $(call htlatex,$@,$<)
bos@0 47
bos@4 48 html/split/hgbook.html: $(sources) examples
bos@0 49 $(call htlatex,$@,$<,2)
bos@0 50
bos@4 51 .PHONY: examples
bos@4 52
bos@4 53 examples: examples/.run
bos@4 54
bos@4 55 examples/.run: $(example-sources)
bos@4 56 cd examples && ./run-example
bos@4 57
bos@0 58 clean:
bos@7 59 rm -rf html pdf *.aux *.dvi *.log *.out examples/*.out examples/.run