hgbook
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/en/Makefile Fri Jun 23 12:15:22 2006 -0700 1.3 @@ -0,0 +1,36 @@ 1.4 +sources := 00book.tex mq.tex 1.5 + 1.6 +latex-options = \ 1.7 + -interaction batchmode \ 1.8 + -output-directory $(dir $(1)) \ 1.9 + -jobname $(basename $(notdir $(1))) 1.10 + 1.11 +all: pdf html 1.12 + 1.13 +pdf: pdf/hgbook.pdf 1.14 + 1.15 +pdf/hgbook.pdf: $(sources) 1.16 + mkdir -p $(dir $@) 1.17 + pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.18 + pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.19 + pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) 1.20 + 1.21 +html: html/onepage/hgbook.html html/split/hgbook.html 1.22 + 1.23 +define htlatex 1.24 + mkdir -p $(dir $(1)) 1.25 + head -4 $(shell which htlatex) > $(dir $(1))/htlatex.book 1.26 + chmod 755 $(dir $(1))/htlatex.book 1.27 + $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1) 1.28 + cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf 1.29 + cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) 1.30 +endef 1.31 + 1.32 +html/onepage/hgbook.html: $(sources) 1.33 + $(call htlatex,$@,$<) 1.34 + 1.35 +html/split/hgbook.html: $(sources) 1.36 + $(call htlatex,$@,$<,2) 1.37 + 1.38 +clean: 1.39 + rm -rf html pdf *.aux *.dvi *.log *.out