hgbook

view 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
line source
1 sources := \
2 00book.tex \
3 99book.bib \
4 99defs.tex \
5 mq.tex
7 example-sources := \
8 examples/run-example \
9 examples/mq.qinit-help \
10 examples/mq.tutorial
12 latex-options = \
13 -interaction batchmode \
14 -output-directory $(dir $(1)) \
15 -jobname $(basename $(notdir $(1)))
17 all: pdf html
19 pdf: pdf/hgbook.pdf
21 pdf/hgbook.pdf: $(sources) examples
22 mkdir -p $(dir $@)
23 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
24 cp 99book.bib $(dir $@)
25 cd $(dir $@) && bibtex $(basename $(notdir $@))
26 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
27 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
29 html: html/onepage/hgbook.html html/split/hgbook.html
31 define htlatex
32 mkdir -p $(dir $(1))
33 head -2 $(shell which htlatex) > $(dir $(1))/htlatex.book
34 cp 99book.bib $(dir $@)
35 echo '(cd $(dir $@) && bibtex $(basename $(notdir $@)))' >> $(dir $(1))/htlatex.book
36 head -3 $(shell which htlatex) >> $(dir $(1))/htlatex.book
37 echo 'echo status $$$$' >> $(dir $(1))/htlatex.book
38 chmod 755 $(dir $(1))/htlatex.book
39 $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
40 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf
41 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1)))
42 perl -pi -e 's/&#x00([0-7][0-9a-f]);/chr(hex($$1))/egi' $(dir $(1))/*.html
43 endef
45 html/onepage/hgbook.html: $(sources) examples
46 $(call htlatex,$@,$<)
48 html/split/hgbook.html: $(sources) examples
49 $(call htlatex,$@,$<,2)
51 .PHONY: examples
53 examples: examples/.run
55 examples/.run: $(example-sources)
56 cd examples && ./run-example
58 clean:
59 rm -rf html pdf *.aux *.dvi *.log *.out examples/*.out examples/.run