Mercurial > hgbook
diff en/Makefile @ 4:33a2e7b9978d
Make it possible to include example input and output from real programs.
Instead of having to cut and paste example text, the task is automated.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sun, 25 Jun 2006 22:04:50 -0700 |
parents | 379a802c0210 |
children | 339e75288632 |
line wrap: on
line diff
--- a/en/Makefile Sat Jun 24 17:42:40 2006 -0700 +++ b/en/Makefile Sun Jun 25 22:04:50 2006 -0700 @@ -4,6 +4,10 @@ 99defs.tex \ mq.tex +example-sources := \ + examples/run-example \ + examples/mq.qinit-help + latex-options = \ -interaction batchmode \ -output-directory $(dir $(1)) \ @@ -13,7 +17,7 @@ pdf: pdf/hgbook.pdf -pdf/hgbook.pdf: $(sources) +pdf/hgbook.pdf: $(sources) examples mkdir -p $(dir $@) pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) cp 99book.bib $(dir $@) @@ -32,11 +36,18 @@ cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) endef -html/onepage/hgbook.html: $(sources) +html/onepage/hgbook.html: $(sources) examples $(call htlatex,$@,$<) -html/split/hgbook.html: $(sources) +html/split/hgbook.html: $(sources) examples $(call htlatex,$@,$<,2) +.PHONY: examples + +examples: examples/.run + +examples/.run: $(example-sources) + cd examples && ./run-example + clean: rm -rf html pdf *.aux *.dvi *.log *.out