| 1 | ## Define the appropriate configuration variables.
 | 
|---|
| 2 | 
 | 
|---|
| 3 | TeXLIB = .:./style:./text:./annex:./build:../../LaTeXmacros:../../LaTeXmacros/listings:../../LaTeXmacros/enumitem:~/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/intro \
 | 
|---|
| 15 | text/cforall \
 | 
|---|
| 16 | text/basics \
 | 
|---|
| 17 | text/concurrency \
 | 
|---|
| 18 | text/parallelism \
 | 
|---|
| 19 | }
 | 
|---|
| 20 | 
 | 
|---|
| 21 | FIGURES = ${addprefix build/, ${addsuffix .tex, \
 | 
|---|
| 22 |         monitor \
 | 
|---|
| 23 |         ext_monitor \
 | 
|---|
| 24 | }}
 | 
|---|
| 25 | 
 | 
|---|
| 26 | PICTURES = ${addsuffix .pstex, \
 | 
|---|
| 27 | }
 | 
|---|
| 28 | 
 | 
|---|
| 29 | PROGRAMS = ${addsuffix .tex, \
 | 
|---|
| 30 | }
 | 
|---|
| 31 | 
 | 
|---|
| 32 | GRAPHS = ${addsuffix .tex, \
 | 
|---|
| 33 | }
 | 
|---|
| 34 | 
 | 
|---|
| 35 | ## Define the documents that need to be made.
 | 
|---|
| 36 | 
 | 
|---|
| 37 | DOCUMENT = thesis.pdf
 | 
|---|
| 38 | 
 | 
|---|
| 39 | # Directives #
 | 
|---|
| 40 | 
 | 
|---|
| 41 | all : ${DOCUMENT}
 | 
|---|
| 42 | 
 | 
|---|
| 43 | clean :
 | 
|---|
| 44 |         @rm -fv ${DOCUMENT} \
 | 
|---|
| 45 |         build/*.acn     \
 | 
|---|
| 46 |         build/*.acr     \
 | 
|---|
| 47 |         build/*.alg     \
 | 
|---|
| 48 |         build/*.aux     \
 | 
|---|
| 49 |         build/*.bbl     \
 | 
|---|
| 50 |         build/*.blg     \
 | 
|---|
| 51 |         build/*.brf     \
 | 
|---|
| 52 |         build/*.cf      \
 | 
|---|
| 53 |         build/*.dvi     \
 | 
|---|
| 54 |         build/*.glg     \
 | 
|---|
| 55 |         build/*.glo     \
 | 
|---|
| 56 |         build/*.gls     \
 | 
|---|
| 57 |         build/*.ist     \
 | 
|---|
| 58 |         build/*.idx     \
 | 
|---|
| 59 |         build/*.ilg     \
 | 
|---|
| 60 |         build/*.ind     \
 | 
|---|
| 61 |         build/*.log     \
 | 
|---|
| 62 |         build/*.out     \
 | 
|---|
| 63 |         build/*.ps      \
 | 
|---|
| 64 |         build/*.pstex_t \
 | 
|---|
| 65 |         build/*.tex     \
 | 
|---|
| 66 |         build/*.toc     \
 | 
|---|
| 67 | 
 | 
|---|
| 68 | 
 | 
|---|
| 69 | # File Dependencies #
 | 
|---|
| 70 | 
 | 
|---|
| 71 | ${DOCUMENT} : build/${basename ${DOCUMENT}}.ps
 | 
|---|
| 72 |         ps2pdf $<
 | 
|---|
| 73 | 
 | 
|---|
| 74 | build/${basename ${DOCUMENT}}.ps : build/${basename ${DOCUMENT}}.dvi
 | 
|---|
| 75 |         dvips $< -o $@
 | 
|---|
| 76 | 
 | 
|---|
| 77 | build/${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex ../../LaTeXmacros/common.tex ../../LaTeXmacros/indexstyle
 | 
|---|
| 78 | 
 | 
|---|
| 79 |         @ if [ ! -r ${basename $@}.ind ] ; then touch ${basename $@}.ind ; fi                           # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run.
 | 
|---|
| 80 |         @ echo "Citation lookup"                                                                                        # Must have *.aux file containing citations for bibtex
 | 
|---|
| 81 |         @ if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename ${notdir $@}}.tex ; fi
 | 
|---|
| 82 |         @ echo "Citation Pass 1"
 | 
|---|
| 83 |         @ -${BibTeX} ${basename $@}                                                                                     # Some citations reference others so run steps again to resolve these citations
 | 
|---|
| 84 |         @ echo "Citation Pass 2"
 | 
|---|
| 85 |         @ ${LaTeX} ${basename ${notdir $@}}.tex
 | 
|---|
| 86 |         @ -${BibTeX} ${basename $@}
 | 
|---|
| 87 |         @ echo "Glossary"
 | 
|---|
| 88 |         makeglossaries -q -s ${basename $@}.ist ${basename $@}                                          # Make index from *.aux entries and input index at end of document
 | 
|---|
| 89 |         @ echo ".dvi generation"
 | 
|---|
| 90 |         @ -build/bump_ver.sh
 | 
|---|
| 91 |         @ ${LaTeX} ${basename ${notdir $@}}.tex                                                                 # Run again to get index title into table of contents
 | 
|---|
| 92 | 
 | 
|---|
| 93 | 
 | 
|---|
| 94 | predefined :
 | 
|---|
| 95 |         sed -f predefined.sed ${basename ${DOCUMENT}}.tex > ${basename $@}.cf
 | 
|---|
| 96 | 
 | 
|---|
| 97 | ## Define the default recipes.
 | 
|---|
| 98 | 
 | 
|---|
| 99 | build/%.tex : figures/%.fig
 | 
|---|
| 100 |         fig2dev -L eepic $< > $@
 | 
|---|
| 101 | 
 | 
|---|
| 102 | build/%.ps : figures/%.fig
 | 
|---|
| 103 |         fig2dev -L ps $< > $@
 | 
|---|
| 104 | 
 | 
|---|
| 105 | build/%.pstex : figures/%.fig
 | 
|---|
| 106 |         fig2dev -L pstex $< > $@
 | 
|---|
| 107 |         fig2dev -L pstex_t -p $@ $< > $@_t
 | 
|---|
| 108 | 
 | 
|---|
| 109 | 
 | 
|---|
| 110 | # Local Variables: #
 | 
|---|
| 111 | # compile-command: "make" #
 | 
|---|
| 112 | # End: #
 | 
|---|