comparison en/Makefile @ 0:76fba5835a1b

Beginnings of a build process and file layout.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri, 23 Jun 2006 12:15:22 -0700
parents
children 379a802c0210
comparison
equal deleted inserted replaced
-1:000000000000 0:76fba5835a1b
1 sources := 00book.tex mq.tex
2
3 latex-options = \
4 -interaction batchmode \
5 -output-directory $(dir $(1)) \
6 -jobname $(basename $(notdir $(1)))
7
8 all: pdf html
9
10 pdf: pdf/hgbook.pdf
11
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)
17
18 html: html/onepage/hgbook.html html/split/hgbook.html
19
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
28
29 html/onepage/hgbook.html: $(sources)
30 $(call htlatex,$@,$<)
31
32 html/split/hgbook.html: $(sources)
33 $(call htlatex,$@,$<,2)
34
35 clean:
36 rm -rf html pdf *.aux *.dvi *.log *.out