1 | ## Define the appropriate configuration variables. |
---|
2 | |
---|
3 | TeXLIB = .:./style:./text:./annex:./build:../../LaTeXmacros:../../LaTeXmacros/listings:../../LaTeXmacros/enumitem:~/bibliographies:/usr/local/bibliographies: |
---|
4 | LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=build -interaction=nonstopmode |
---|
5 | BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex -terse |
---|
6 | |
---|
7 | ## Define the text source files. |
---|
8 | |
---|
9 | SOURCES = ${addsuffix .tex, \ |
---|
10 | thesis \ |
---|
11 | style/style \ |
---|
12 | style/cfa-format \ |
---|
13 | annex/glossary \ |
---|
14 | text/frontpgs \ |
---|
15 | text/intro \ |
---|
16 | text/basics \ |
---|
17 | text/cforall \ |
---|
18 | text/concurrency \ |
---|
19 | text/internals \ |
---|
20 | text/parallelism \ |
---|
21 | text/results \ |
---|
22 | text/together \ |
---|
23 | text/future \ |
---|
24 | } |
---|
25 | |
---|
26 | FIGURES = ${addprefix build/, ${addsuffix .tex, \ |
---|
27 | monitor \ |
---|
28 | ext_monitor \ |
---|
29 | int_monitor \ |
---|
30 | dependency \ |
---|
31 | }} |
---|
32 | |
---|
33 | PICTURES = ${addprefix build/, ${addsuffix .pstex, \ |
---|
34 | system \ |
---|
35 | monitor_structs \ |
---|
36 | }} |
---|
37 | |
---|
38 | PROGRAMS = ${addsuffix .tex, \ |
---|
39 | } |
---|
40 | |
---|
41 | GRAPHS = ${addsuffix .tex, \ |
---|
42 | } |
---|
43 | |
---|
44 | ## Define the documents that need to be made. |
---|
45 | |
---|
46 | DOCUMENT = thesis.pdf |
---|
47 | |
---|
48 | # Directives # |
---|
49 | |
---|
50 | all : ${DOCUMENT} |
---|
51 | |
---|
52 | clean : |
---|
53 | @rm -fv ${DOCUMENT} \ |
---|
54 | build/*.acn \ |
---|
55 | build/*.acr \ |
---|
56 | build/*.alg \ |
---|
57 | build/*.aux \ |
---|
58 | build/*.bbl \ |
---|
59 | build/*.blg \ |
---|
60 | build/*.brf \ |
---|
61 | build/*.cf \ |
---|
62 | build/*.dvi \ |
---|
63 | build/*.glg \ |
---|
64 | build/*.glo \ |
---|
65 | build/*.gls \ |
---|
66 | build/*.ist \ |
---|
67 | build/*.idx \ |
---|
68 | build/*.ilg \ |
---|
69 | build/*.ind \ |
---|
70 | build/*.log \ |
---|
71 | build/*.out \ |
---|
72 | build/*.ps \ |
---|
73 | build/*.pstex \ |
---|
74 | build/*.pstex_t \ |
---|
75 | build/*.tex \ |
---|
76 | build/*.toc \ |
---|
77 | build/*.lof \ |
---|
78 | build/*.lol \ |
---|
79 | build/*.lot \ |
---|
80 | figures/*.tex \ |
---|
81 | *.png \ |
---|
82 | |
---|
83 | |
---|
84 | # File Dependencies # |
---|
85 | |
---|
86 | ${DOCUMENT} : build/${basename ${DOCUMENT}}.ps |
---|
87 | ps2pdf $< |
---|
88 | |
---|
89 | build/${basename ${DOCUMENT}}.ps : build/${basename ${DOCUMENT}}.dvi |
---|
90 | dvips $< -o $@ |
---|
91 | |
---|
92 | build/${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex ../../LaTeXmacros/common.tex ../../LaTeXmacros/indexstyle annex/local.bib |
---|
93 | |
---|
94 | @ if [ ! -r ${basename $@}.ind ] ; then touch ${basename $@}.ind ; fi # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. |
---|
95 | @ echo "Citation lookup" # Must have *.aux file containing citations for bibtex |
---|
96 | @ if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename ${notdir $@}}.tex ; fi |
---|
97 | @ echo "Citation Pass 1" |
---|
98 | @ -${BibTeX} ${basename $@} # Some citations reference others so run steps again to resolve these citations |
---|
99 | @ echo "Citation Pass 2" |
---|
100 | @ ${LaTeX} ${basename ${notdir $@}}.tex |
---|
101 | @ -${BibTeX} ${basename $@} |
---|
102 | @ echo "Glossary" |
---|
103 | @ makeglossaries -q -s ${basename $@}.ist ${basename $@} # Make index from *.aux entries and input index at end of document |
---|
104 | @ echo ".dvi generation" |
---|
105 | @ -build/bump_ver.sh |
---|
106 | @ ${LaTeX} ${basename ${notdir $@}}.tex # Run again to get index title into table of contents |
---|
107 | |
---|
108 | |
---|
109 | predefined : |
---|
110 | sed -f predefined.sed ${basename ${DOCUMENT}}.tex > ${basename $@}.cf |
---|
111 | |
---|
112 | ## Define the default recipes. |
---|
113 | |
---|
114 | build/%.tex : figures/%.fig |
---|
115 | fig2dev -L eepic $< > $@ |
---|
116 | |
---|
117 | build/%.ps : figures/%.fig |
---|
118 | fig2dev -L ps $< > $@ |
---|
119 | |
---|
120 | build/%.pstex : figures/%.fig |
---|
121 | fig2dev -L pstex $< > $@ |
---|
122 | fig2dev -L pstex_t -p $@ $< > $@_t |
---|
123 | |
---|
124 | figures/%.tex: build/%.pstex |
---|
125 | echo -n "\documentclass[preview]{standalone}\n" \ |
---|
126 | "\usepackage[T1]{fontenc}\n" \ |
---|
127 | "\usepackage[usenames]{color}\n" \ |
---|
128 | "\usepackage{graphicx}\n" \ |
---|
129 | "\usepackage{listings}\n" \ |
---|
130 | "\usepackage{xspace}\n" \ |
---|
131 | "\input{style}\n" \ |
---|
132 | "\\\\begin{document}\n" \ |
---|
133 | "{\\\\resizebox{3\\\\textwidth}{!}{\input{${basename ${notdir $@}}.pstex_t}}}\n" \ |
---|
134 | "\end{document}" > $@ |
---|
135 | |
---|
136 | %.png : build/%.pstex figures/%.tex |
---|
137 | echo ${basename $@} |
---|
138 | ${LaTeX} figures/${basename $@}.tex |
---|
139 | dvips build/${basename $@}.dvi -o build/${basename $@}.ps |
---|
140 | ps2pdf build/${basename $@}.ps |
---|
141 | convert -negate ${basename $@}.pdf $@ |
---|
142 | |
---|
143 | |
---|
144 | |
---|
145 | # Local Variables: # |
---|
146 | # compile-command: "make" # |
---|
147 | # End: # |
---|