1 | ## Define the configuration variables. |
---|
2 | |
---|
3 | Build = build |
---|
4 | Figures = img |
---|
5 | Macros = ../../../LaTeXmacros |
---|
6 | TeXLIB = .:${Macros}:${Build}:../../../bibliography: |
---|
7 | LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=${Build} |
---|
8 | BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex |
---|
9 | |
---|
10 | MAKEFLAGS = --no-print-directory --silent # |
---|
11 | VPATH = ${Build} ${Figures} |
---|
12 | |
---|
13 | ## Define the text source files. |
---|
14 | TEXTS = ${addprefix text/, ${addsuffix .tex, \ |
---|
15 | front \ |
---|
16 | intro \ |
---|
17 | runtime \ |
---|
18 | core \ |
---|
19 | practice \ |
---|
20 | io \ |
---|
21 | }} |
---|
22 | |
---|
23 | FIGURES = ${addsuffix .tex, \ |
---|
24 | } |
---|
25 | |
---|
26 | PICTURES = ${addsuffix .pstex, \ |
---|
27 | base \ |
---|
28 | empty \ |
---|
29 | } |
---|
30 | |
---|
31 | PROGRAMS = ${addsuffix .tex, \ |
---|
32 | } |
---|
33 | |
---|
34 | GRAPHS = ${addsuffix .tex, \ |
---|
35 | } |
---|
36 | |
---|
37 | ## Define the documents that need to be made. |
---|
38 | all: thesis.pdf |
---|
39 | thesis.pdf: ${TEXTS} ${FIGURES} ${PICTURES} |
---|
40 | |
---|
41 | DOCUMENT = thesis.pdf |
---|
42 | BASE = ${basename ${DOCUMENT}} |
---|
43 | |
---|
44 | # Directives # |
---|
45 | |
---|
46 | .PHONY : all clean # not file names |
---|
47 | |
---|
48 | all : ${DOCUMENT} |
---|
49 | |
---|
50 | clean : |
---|
51 | @rm -frv ${DOCUMENT} ${BASE}.ps ${Build} |
---|
52 | |
---|
53 | # File Dependencies # |
---|
54 | |
---|
55 | %.pdf : build/%.ps | ${Build} |
---|
56 | ps2pdf $< |
---|
57 | |
---|
58 | build/%.ps : build/%.dvi | ${Build} |
---|
59 | dvips $< -o $@ |
---|
60 | |
---|
61 | build/%.dvi : %.tex Makefile | ${Build} |
---|
62 | # Must have *.aux file containing citations for bibtex |
---|
63 | if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} $< ; fi |
---|
64 | -${BibTeX} ${basename $@} |
---|
65 | # Some citations reference others so run again to resolve these citations |
---|
66 | ${LaTeX} $< |
---|
67 | -${BibTeX} ${basename $@} |
---|
68 | # Make index from *.aux entries and input index at end of document |
---|
69 | -makeglossaries -q -s ${basename $@}.ist ${basename $@} |
---|
70 | # Run again to finish citations |
---|
71 | ${LaTeX} $< |
---|
72 | |
---|
73 | ## Define the default recipes. |
---|
74 | |
---|
75 | ${Build}: |
---|
76 | mkdir -p ${Build} |
---|
77 | |
---|
78 | %.tex : fig/%.fig | ${Build} |
---|
79 | fig2dev -L eepic $< > ${Build}/$@ |
---|
80 | |
---|
81 | %.ps : fig/%.fig | ${Build} |
---|
82 | fig2dev -L ps $< > ${Build}/$@ |
---|
83 | |
---|
84 | %.pstex : fig/%.fig | ${Build} |
---|
85 | fig2dev -L pstex $< > ${Build}/$@ |
---|
86 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
87 | |
---|
88 | ## pstex with inverted colors |
---|
89 | %.dark.pstex : fig/%.fig Makefile | ${Build} |
---|
90 | fig2dev -L pstex $< > ${Build}/$@ |
---|
91 | sed -i 's/\/col-1 {0 setgray} bind def/\/col-1 {1 setgray} bind def/g' ${Build}/$@ |
---|
92 | sed -i 's/\/col0 {0.000 0.000 0.000 srgb} bind def/\/col0 {1.000 1.000 1.000 srgb} bind def/g' ${Build}/$@ |
---|
93 | sed -i 's/\/col7 {1.000 1.000 1.000 srgb} bind def/\/col7 {0.000 0.000 0.000 srgb} bind def/g' ${Build}/$@ |
---|
94 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
95 | |
---|
96 | # Local Variables: # |
---|
97 | # compile-command: "make" # |
---|
98 | # End: # |
---|