hgbook

view 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
line source
1 sources := 00book.tex mq.tex
3 latex-options = \
4 -interaction batchmode \
5 -output-directory $(dir $(1)) \
6 -jobname $(basename $(notdir $(1)))
8 all: pdf html
10 pdf: pdf/hgbook.pdf
12 pdf/hgbook.pdf: $(sources)
13 mkdir -p $(dir $@)
14 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
15 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
16 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
18 html: html/onepage/hgbook.html html/split/hgbook.html
20 define htlatex
21 mkdir -p $(dir $(1))
22 head -4 $(shell which htlatex) > $(dir $(1))/htlatex.book
23 chmod 755 $(dir $(1))/htlatex.book
24 $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
25 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf
26 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1)))
27 endef
29 html/onepage/hgbook.html: $(sources)
30 $(call htlatex,$@,$<)
32 html/split/hgbook.html: $(sources)
33 $(call htlatex,$@,$<,2)
35 clean:
36 rm -rf html pdf *.aux *.dvi *.log *.out