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 | existing \ |
---|
18 | runtime \ |
---|
19 | core \ |
---|
20 | practice \ |
---|
21 | io \ |
---|
22 | }} |
---|
23 | |
---|
24 | FIGURES = ${addsuffix .tex, \ |
---|
25 | } |
---|
26 | |
---|
27 | PICTURES = ${addsuffix .pstex, \ |
---|
28 | base \ |
---|
29 | empty \ |
---|
30 | emptybit \ |
---|
31 | emptytls \ |
---|
32 | emptytree \ |
---|
33 | fairness \ |
---|
34 | system \ |
---|
35 | } |
---|
36 | |
---|
37 | PROGRAMS = ${addsuffix .tex, \ |
---|
38 | } |
---|
39 | |
---|
40 | GRAPHS = ${addsuffix .tex, \ |
---|
41 | } |
---|
42 | |
---|
43 | ## Define the documents that need to be made. |
---|
44 | all: thesis.pdf |
---|
45 | thesis.pdf: ${TEXTS} ${FIGURES} ${PICTURES} glossary.tex local.bib |
---|
46 | |
---|
47 | DOCUMENT = thesis.pdf |
---|
48 | BASE = ${basename ${DOCUMENT}} |
---|
49 | |
---|
50 | # Directives # |
---|
51 | |
---|
52 | .PHONY : all clean # not file names |
---|
53 | |
---|
54 | all : ${DOCUMENT} |
---|
55 | |
---|
56 | clean : |
---|
57 | @rm -frv ${DOCUMENT} ${BASE}.ps ${Build} |
---|
58 | |
---|
59 | # File Dependencies # |
---|
60 | |
---|
61 | %.pdf : build/%.ps | ${Build} |
---|
62 | ps2pdf $< |
---|
63 | |
---|
64 | build/%.ps : build/%.dvi | ${Build} |
---|
65 | dvips $< -o $@ |
---|
66 | |
---|
67 | build/%.dvi : %.tex Makefile | ${Build} |
---|
68 | # Must have *.aux file containing citations for bibtex |
---|
69 | if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} $< ; fi |
---|
70 | -${BibTeX} ${basename $@} |
---|
71 | # Some citations reference others so run again to resolve these citations |
---|
72 | ${LaTeX} $< |
---|
73 | -${BibTeX} ${basename $@} |
---|
74 | # Make index from *.aux entries and input index at end of document |
---|
75 | -makeglossaries -q -s ${basename $@}.ist ${basename $@} |
---|
76 | # Run again to finish citations |
---|
77 | ${LaTeX} $< |
---|
78 | |
---|
79 | build/fairness.svg : fig/fairness.py | ${Build} |
---|
80 | python3 $< $@ |
---|
81 | |
---|
82 | ## Define the default recipes. |
---|
83 | |
---|
84 | ${Build}: |
---|
85 | mkdir -p ${Build} |
---|
86 | |
---|
87 | %.tex : fig/%.fig | ${Build} |
---|
88 | fig2dev -L eepic $< > ${Build}/$@ |
---|
89 | |
---|
90 | %.ps : fig/%.fig | ${Build} |
---|
91 | fig2dev -L ps $< > ${Build}/$@ |
---|
92 | |
---|
93 | %.pstex : fig/%.fig | ${Build} |
---|
94 | fig2dev -L pstex $< > ${Build}/$@ |
---|
95 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
96 | |
---|
97 | %.pstex : build/%.svg | ${Build} |
---|
98 | inkscape -z -D --file=$< --export-eps=${Build}/$@ --export-latex |
---|
99 | mv ${Build}/$@_tex ${Build}/$@_t |
---|
100 | echo "sed -i 's/$@/${Build}/$@/g' ${Build}/$@_t" |
---|
101 | sed -i 's/$@/${Build}\/$@/g' ${Build}/$@_t |
---|
102 | |
---|
103 | ## pstex with inverted colors |
---|
104 | %.dark.pstex : fig/%.fig Makefile | ${Build} |
---|
105 | fig2dev -L pstex $< > ${Build}/$@ |
---|
106 | sed -i 's/\/col-1 {0 setgray} bind def/\/col-1 {1 setgray} bind def/g' ${Build}/$@ |
---|
107 | 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}/$@ |
---|
108 | 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}/$@ |
---|
109 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
110 | |
---|
111 | # Local Variables: # |
---|
112 | # compile-command: "make" # |
---|
113 | # End: # |
---|