hgbook

annotate en/Makefile @ 2:379a802c0210

Add bibliography.
author Bryan O'Sullivan <bos@serpentine.com>
date Sat Jun 24 16:14:02 2006 -0700 (2006-06-24)
parents 76fba5835a1b
children 33a2e7b9978d
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@0 7 latex-options = \
bos@0 8 -interaction batchmode \
bos@0 9 -output-directory $(dir $(1)) \
bos@0 10 -jobname $(basename $(notdir $(1)))
bos@0 11
bos@0 12 all: pdf html
bos@0 13
bos@0 14 pdf: pdf/hgbook.pdf
bos@0 15
bos@0 16 pdf/hgbook.pdf: $(sources)
bos@0 17 mkdir -p $(dir $@)
bos@0 18 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@2 19 cp 99book.bib $(dir $@)
bos@2 20 cd $(dir $@) && bibtex $(basename $(notdir $@))
bos@0 21 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@0 22 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@0 23
bos@0 24 html: html/onepage/hgbook.html html/split/hgbook.html
bos@0 25
bos@0 26 define htlatex
bos@0 27 mkdir -p $(dir $(1))
bos@0 28 head -4 $(shell which htlatex) > $(dir $(1))/htlatex.book
bos@0 29 chmod 755 $(dir $(1))/htlatex.book
bos@0 30 $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
bos@0 31 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf
bos@0 32 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1)))
bos@0 33 endef
bos@0 34
bos@0 35 html/onepage/hgbook.html: $(sources)
bos@0 36 $(call htlatex,$@,$<)
bos@0 37
bos@0 38 html/split/hgbook.html: $(sources)
bos@0 39 $(call htlatex,$@,$<,2)
bos@0 40
bos@0 41 clean:
bos@0 42 rm -rf html pdf *.aux *.dvi *.log *.out