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