hgbook

annotate en/Makefile @ 0:76fba5835a1b

Beginnings of a build process and file layout.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri Jun 23 12:15:22 2006 -0700 (2006-06-23)
parents
children 379a802c0210
rev   line source
bos@0 1 sources := 00book.tex mq.tex
bos@0 2
bos@0 3 latex-options = \
bos@0 4 -interaction batchmode \
bos@0 5 -output-directory $(dir $(1)) \
bos@0 6 -jobname $(basename $(notdir $(1)))
bos@0 7
bos@0 8 all: pdf html
bos@0 9
bos@0 10 pdf: pdf/hgbook.pdf
bos@0 11
bos@0 12 pdf/hgbook.pdf: $(sources)
bos@0 13 mkdir -p $(dir $@)
bos@0 14 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@0 15 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@0 16 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
bos@0 17
bos@0 18 html: html/onepage/hgbook.html html/split/hgbook.html
bos@0 19
bos@0 20 define htlatex
bos@0 21 mkdir -p $(dir $(1))
bos@0 22 head -4 $(shell which htlatex) > $(dir $(1))/htlatex.book
bos@0 23 chmod 755 $(dir $(1))/htlatex.book
bos@0 24 $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
bos@0 25 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf
bos@0 26 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1)))
bos@0 27 endef
bos@0 28
bos@0 29 html/onepage/hgbook.html: $(sources)
bos@0 30 $(call htlatex,$@,$<)
bos@0 31
bos@0 32 html/split/hgbook.html: $(sources)
bos@0 33 $(call htlatex,$@,$<,2)
bos@0 34
bos@0 35 clean:
bos@0 36 rm -rf html pdf *.aux *.dvi *.log *.out