[86c1f1c3] | 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 | |
---|
[bace538] | 10 | MAKEFLAGS = --no-print-directory --silent |
---|
[86c1f1c3] | 11 | VPATH = ${Build} ${Figures} |
---|
| 12 | |
---|
| 13 | ## Define the text source files. |
---|
| 14 | TEXTS = ${addprefix text/, ${addsuffix .tex, \ |
---|
| 15 | front \ |
---|
| 16 | intro \ |
---|
[b9537e6] | 17 | existing \ |
---|
[86c1f1c3] | 18 | runtime \ |
---|
| 19 | core \ |
---|
| 20 | practice \ |
---|
| 21 | io \ |
---|
| 22 | }} |
---|
| 23 | |
---|
| 24 | FIGURES = ${addsuffix .tex, \ |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | PICTURES = ${addsuffix .pstex, \ |
---|
| 28 | base \ |
---|
| 29 | empty \ |
---|
[c04a19e] | 30 | emptybit \ |
---|
| 31 | emptytls \ |
---|
| 32 | emptytree \ |
---|
| 33 | fairness \ |
---|
[b9537e6] | 34 | system \ |
---|
[86c1f1c3] | 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 |
---|
[b9537e6] | 45 | thesis.pdf: ${TEXTS} ${FIGURES} ${PICTURES} glossary.tex local.bib |
---|
[86c1f1c3] | 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} |
---|
[bace538] | 68 | # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. |
---|
| 69 | if [ ! -r ${basename $@}.ind ] ; then touch ${basename $@}.ind ; fi |
---|
[86c1f1c3] | 70 | # Must have *.aux file containing citations for bibtex |
---|
| 71 | if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} $< ; fi |
---|
| 72 | -${BibTeX} ${basename $@} |
---|
| 73 | # Some citations reference others so run again to resolve these citations |
---|
| 74 | ${LaTeX} $< |
---|
| 75 | -${BibTeX} ${basename $@} |
---|
| 76 | # Make index from *.aux entries and input index at end of document |
---|
| 77 | -makeglossaries -q -s ${basename $@}.ist ${basename $@} |
---|
[bace538] | 78 | # Make index from *.aux entries and input index at end of document |
---|
| 79 | -makeindex ${basename $@}.idx |
---|
[86c1f1c3] | 80 | # Run again to finish citations |
---|
| 81 | ${LaTeX} $< |
---|
| 82 | |
---|
[c04a19e] | 83 | build/fairness.svg : fig/fairness.py | ${Build} |
---|
| 84 | python3 $< $@ |
---|
| 85 | |
---|
[86c1f1c3] | 86 | ## Define the default recipes. |
---|
| 87 | |
---|
| 88 | ${Build}: |
---|
| 89 | mkdir -p ${Build} |
---|
| 90 | |
---|
| 91 | %.tex : fig/%.fig | ${Build} |
---|
| 92 | fig2dev -L eepic $< > ${Build}/$@ |
---|
| 93 | |
---|
| 94 | %.ps : fig/%.fig | ${Build} |
---|
| 95 | fig2dev -L ps $< > ${Build}/$@ |
---|
| 96 | |
---|
| 97 | %.pstex : fig/%.fig | ${Build} |
---|
| 98 | fig2dev -L pstex $< > ${Build}/$@ |
---|
| 99 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
| 100 | |
---|
[c04a19e] | 101 | %.pstex : build/%.svg | ${Build} |
---|
| 102 | inkscape -z -D --file=$< --export-eps=${Build}/$@ --export-latex |
---|
| 103 | mv ${Build}/$@_tex ${Build}/$@_t |
---|
| 104 | echo "sed -i 's/$@/${Build}/$@/g' ${Build}/$@_t" |
---|
| 105 | sed -i 's/$@/${Build}\/$@/g' ${Build}/$@_t |
---|
| 106 | |
---|
[86c1f1c3] | 107 | ## pstex with inverted colors |
---|
| 108 | %.dark.pstex : fig/%.fig Makefile | ${Build} |
---|
| 109 | fig2dev -L pstex $< > ${Build}/$@ |
---|
| 110 | sed -i 's/\/col-1 {0 setgray} bind def/\/col-1 {1 setgray} bind def/g' ${Build}/$@ |
---|
| 111 | 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}/$@ |
---|
| 112 | 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}/$@ |
---|
| 113 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
| 114 | |
---|
| 115 | # Local Variables: # |
---|
| 116 | # compile-command: "make" # |
---|
| 117 | # End: # |
---|