Mercurial > hgbook
annotate en/Makefile @ 16:81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 03 Jul 2006 22:43:52 -0700 |
parents | e9d5b4c3d16b |
children | e6f4088ebe52 |
rev | line source |
---|---|
2 | 1 sources := \ |
2 00book.tex \ | |
3 99book.bib \ | |
4 99defs.tex \ | |
16
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
5 intro.tex \ |
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
6 mq.tex \ |
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
7 build_id.tex |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
8 |
11 | 9 image-sources := \ |
10 mq-stack.svg | |
11 | |
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
12 example-sources := \ |
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
13 examples/run-example \ |
7
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
14 examples/mq.qinit-help \ |
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
15 examples/mq.tutorial |
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
16 |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 latex-options = \ |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 -interaction batchmode \ |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
19 -output-directory $(dir $(1)) \ |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
20 -jobname $(basename $(notdir $(1))) |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
21 |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
22 all: pdf html |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
23 |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
24 pdf: pdf/hgbook.pdf |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
25 |
11 | 26 pdf/hgbook.pdf: $(sources) $(image-sources:%.svg=%_pdf.png) examples |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
27 mkdir -p $(dir $@) |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
28 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
2 | 29 cp 99book.bib $(dir $@) |
30 cd $(dir $@) && bibtex $(basename $(notdir $@)) | |
16
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
31 cd $(dir $@) && makeindex $(basename $(notdir $@)) |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
32 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
33 pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1) |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
34 |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
35 html: html/onepage/hgbook.html html/split/hgbook.html |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
37 define htlatex |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
38 mkdir -p $(dir $(1)) |
7
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
39 head -2 $(shell which htlatex) > $(dir $(1))/htlatex.book |
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
40 cp 99book.bib $(dir $@) |
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
41 echo '(cd $(dir $@) && bibtex $(basename $(notdir $@)))' >> $(dir $(1))/htlatex.book |
16
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
42 echo '(cd $(dir $@) && makeindex $(basename $(notdir $@)))' >> $(dir $(1))/htlatex.book |
7
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
43 head -3 $(shell which htlatex) >> $(dir $(1))/htlatex.book |
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
44 echo 'echo status $$$$' >> $(dir $(1))/htlatex.book |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
45 chmod 755 $(dir $(1))/htlatex.book |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
46 $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1) |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
47 cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
48 cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) |
7
339e75288632
More progress on MQ chapter and general support.
Bryan O'Sullivan <bos@serpentine.com>
parents:
4
diff
changeset
|
49 perl -pi -e 's/�([0-7][0-9a-f]);/chr(hex($$1))/egi' $(dir $(1))/*.html |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
50 endef |
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
51 |
11 | 52 html/onepage/hgbook.html: $(sources) $(image-sources:%.svg=%.png) examples |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
53 $(call htlatex,$@,$<) |
11 | 54 cp $(image-sources:%.svg=%.png) $(dir $@) |
55 | |
56 html/split/hgbook.html: $(sources) $(image-sources:%.svg=%.png) examples | |
57 $(call htlatex,$@,$<,2) | |
58 cp $(image-sources:%.svg=%.png) $(dir $@) | |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
59 |
11 | 60 %.png: %.svg |
61 inkscape -D -e $@ $< | |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
62 |
11 | 63 %_pdf.png: %.svg |
64 inkscape -D -d 300 -e $@ $< | |
65 | |
66 %.eps: %.svg | |
67 inkscape -E $@ $< | |
4
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
68 |
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
69 examples: examples/.run |
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
70 |
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
71 examples/.run: $(example-sources) |
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
72 cd examples && ./run-example |
33a2e7b9978d
Make it possible to include example input and output from real programs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
2
diff
changeset
|
73 |
16
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
74 build_id.tex: |
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
75 echo 'in-place build' > $@ |
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
76 |
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
77 build_id: |
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
78 hg id | sed -e 's/ tip\>//' > build_id.tex |
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
79 |
0
76fba5835a1b
Beginnings of a build process and file layout.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
80 clean: |
16
81454425eee9
Progress on a few fronts, mainly indexing and MQ chapter content
Bryan O'Sullivan <bos@serpentine.com>
parents:
11
diff
changeset
|
81 rm -rf html pdf *.eps *.png *.aux *.dvi *.log *.out examples/*.out examples/.run buildrev.tex |