1 | ## Define the configuration variables. |
---|
2 | |
---|
3 | Build = build |
---|
4 | Figures = figures |
---|
5 | Macros = ../../LaTeXmacros |
---|
6 | TeXLIB = .:style:text:annex:${Macros}:${Build}:../../bibliography: |
---|
7 | LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=${Build} |
---|
8 | BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex -terse |
---|
9 | |
---|
10 | MAKEFLAGS = --no-print-directory --silent # |
---|
11 | VPATH = ${Build} ${Figures} |
---|
12 | |
---|
13 | ## Define the text source files. |
---|
14 | |
---|
15 | SOURCES = ${addsuffix .tex, \ |
---|
16 | thesis \ |
---|
17 | style/style \ |
---|
18 | style/cfa-format \ |
---|
19 | annex/glossary \ |
---|
20 | text/frontpgs \ |
---|
21 | text/intro \ |
---|
22 | text/basics \ |
---|
23 | text/cforall \ |
---|
24 | text/concurrency \ |
---|
25 | text/internals \ |
---|
26 | text/parallelism \ |
---|
27 | text/results \ |
---|
28 | text/together \ |
---|
29 | text/future \ |
---|
30 | } |
---|
31 | |
---|
32 | FIGURES = ${addsuffix .tex, \ |
---|
33 | monitor \ |
---|
34 | ext_monitor \ |
---|
35 | int_monitor \ |
---|
36 | dependency \ |
---|
37 | } |
---|
38 | |
---|
39 | PICTURES = ${addsuffix .pstex, \ |
---|
40 | system \ |
---|
41 | monitor_structs \ |
---|
42 | } |
---|
43 | |
---|
44 | PROGRAMS = ${addsuffix .tex, \ |
---|
45 | } |
---|
46 | |
---|
47 | GRAPHS = ${addsuffix .tex, \ |
---|
48 | } |
---|
49 | |
---|
50 | ## Define the documents that need to be made. |
---|
51 | |
---|
52 | DOCUMENT = thesis.pdf |
---|
53 | |
---|
54 | # Directives # |
---|
55 | |
---|
56 | .PHONY : all clean # not file names |
---|
57 | |
---|
58 | all : ${DOCUMENT} |
---|
59 | |
---|
60 | clean : |
---|
61 | @rm -frv ${DOCUMENT} ${basename ${DOCUMENT}}.ps ${Build} |
---|
62 | |
---|
63 | # File Dependencies # |
---|
64 | |
---|
65 | ${DOCUMENT} : ${basename ${DOCUMENT}}.ps |
---|
66 | ps2pdf $< |
---|
67 | |
---|
68 | ${basename ${DOCUMENT}}.ps : ${basename ${DOCUMENT}}.dvi |
---|
69 | dvips ${Build}/$< -o $@ |
---|
70 | |
---|
71 | ${basename ${DOCUMENT}}.dvi : Makefile ${Build} ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} \ |
---|
72 | ${Macros}/common.tex ${Macros}/indexstyle annex/local.bib ../../bibliography/pl.bib |
---|
73 | # Must have *.aux file containing citations for bibtex |
---|
74 | if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename $@}.tex ; fi |
---|
75 | -${BibTeX} ${Build}/${basename $@} |
---|
76 | # Some citations reference others so run again to resolve these citations |
---|
77 | ${LaTeX} ${basename $@}.tex |
---|
78 | -${BibTeX} ${Build}/${basename $@} |
---|
79 | # Make index from *.aux entries and input index at end of document |
---|
80 | makeglossaries -q -s ${Build}/${basename $@}.ist ${Build}/${basename $@} |
---|
81 | -version.sh |
---|
82 | # Run again to finish citations |
---|
83 | ${LaTeX} ${basename $@}.tex |
---|
84 | |
---|
85 | ## Define the default recipes. |
---|
86 | |
---|
87 | ${Build}: |
---|
88 | mkdir -p ${Build} |
---|
89 | |
---|
90 | %.tex : %.fig ${Build} |
---|
91 | fig2dev -L eepic $< > ${Build}/$@ |
---|
92 | |
---|
93 | %.ps : %.fig ${Build} |
---|
94 | fig2dev -L ps $< > ${Build}/$@ |
---|
95 | |
---|
96 | %.pstex : %.fig ${Build} |
---|
97 | fig2dev -L pstex $< > ${Build}/$@ |
---|
98 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
99 | |
---|
100 | #----------------------------------------------------------------------------------- |
---|
101 | # Tools to generate png files |
---|
102 | # to create a png we create a pdf and convert it to png |
---|
103 | %.png : build/%.pstex figures/%.tex ${Build} |
---|
104 | echo ${basename $@} |
---|
105 | ${LaTeX} figures/${basename $@}.tex |
---|
106 | dvips build/${basename $@}.dvi -o build/${basename $@}.ps |
---|
107 | ps2pdf build/${basename $@}.ps |
---|
108 | convert -negate ${basename $@}.pdf $@ |
---|
109 | |
---|
110 | # creating a pdf of a figure requires generating some latex that just includes the figure |
---|
111 | figures/%.tex: build/%.pstex ${Build} |
---|
112 | echo -n "\documentclass[preview]{standalone}\n" \ |
---|
113 | "\usepackage[T1]{fontenc}\n" \ |
---|
114 | "\usepackage[usenames]{color}\n" \ |
---|
115 | "\usepackage{graphicx}\n" \ |
---|
116 | "\usepackage{listings}\n" \ |
---|
117 | "\usepackage{xspace}\n" \ |
---|
118 | "\input{style}\n" \ |
---|
119 | "\\\\begin{document}\n" \ |
---|
120 | "{\\\\resizebox{3\\\\textwidth}{!}{\input{${basename ${notdir $@}}.pstex_t}}}\n" \ |
---|
121 | "\end{document}" > $@ |
---|
122 | |
---|
123 | # Local Variables: # |
---|
124 | # compile-command: "make" # |
---|
125 | # End: # |
---|