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