[46ab782] | 1 | ## Define the configuration variables. |
---|
| 2 | |
---|
| 3 | Build = build |
---|
| 4 | Figures = figures |
---|
| 5 | Macros = ../../LaTeXmacros |
---|
| 6 | TeXLIB = .:style:text:${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, \ |
---|
[601bd9e] | 16 | text/CFA_intro \ |
---|
| 17 | text/actors \ |
---|
[46ab782] | 18 | thesis \ |
---|
| 19 | } |
---|
| 20 | |
---|
[601bd9e] | 21 | FIGURES = ${addsuffix .tikz, \ |
---|
| 22 | figures/standard_actor \ |
---|
| 23 | figures/inverted_actor \ |
---|
| 24 | figures/gulp \ |
---|
[46ab782] | 25 | } |
---|
| 26 | |
---|
| 27 | PICTURES = ${addsuffix .pstex, \ |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | PROGRAMS = ${addsuffix .tex, \ |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | GRAPHS = ${addsuffix .tex, \ |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | ## Define the documents that need to be made. |
---|
| 37 | |
---|
| 38 | DOCUMENT = thesis.pdf |
---|
| 39 | BASE = ${basename ${DOCUMENT}} |
---|
| 40 | |
---|
| 41 | # Directives # |
---|
| 42 | |
---|
| 43 | .PHONY : all clean # not file names |
---|
| 44 | |
---|
| 45 | all : ${DOCUMENT} |
---|
| 46 | |
---|
| 47 | clean : |
---|
| 48 | @rm -frv ${DOCUMENT} ${BASE}.ps ${Build} |
---|
| 49 | |
---|
| 50 | # File Dependencies # |
---|
| 51 | |
---|
| 52 | ${DOCUMENT} : ${BASE}.ps |
---|
| 53 | ps2pdf $< |
---|
| 54 | |
---|
| 55 | ${BASE}.ps : ${BASE}.dvi |
---|
| 56 | dvips ${Build}/$< -o $@ |
---|
| 57 | |
---|
| 58 | ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} \ |
---|
| 59 | ${Macros}/common.tex ${Macros}/indexstyle local.bib ../../bibliography/pl.bib | ${Build} |
---|
| 60 | # Must have *.aux file containing citations for bibtex |
---|
| 61 | if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename $@}.tex ; fi |
---|
| 62 | -${BibTeX} ${Build}/${basename $@} |
---|
| 63 | # Some citations reference others so run again to resolve these citations |
---|
| 64 | ${LaTeX} ${basename $@}.tex |
---|
| 65 | -${BibTeX} ${Build}/${basename $@} |
---|
| 66 | # Make index from *.aux entries and input index at end of document |
---|
| 67 | makeglossaries -q -s ${Build}/${basename $@}.ist ${Build}/${basename $@} |
---|
| 68 | -version.sh |
---|
| 69 | # Run again to finish citations |
---|
| 70 | ${LaTeX} ${basename $@}.tex |
---|
[601bd9e] | 71 | |
---|
[46ab782] | 72 | |
---|
| 73 | ## Define the default recipes. |
---|
| 74 | |
---|
| 75 | ${Build}: |
---|
| 76 | mkdir -p ${Build} |
---|
| 77 | |
---|
| 78 | %.tex : %.fig ${Build} |
---|
| 79 | fig2dev -L eepic $< > ${Build}/$@ |
---|
| 80 | |
---|
| 81 | %.ps : %.fig | ${Build} |
---|
| 82 | fig2dev -L ps $< > ${Build}/$@ |
---|
| 83 | |
---|
| 84 | %.pstex : %.fig | ${Build} |
---|
| 85 | fig2dev -L pstex $< > ${Build}/$@ |
---|
| 86 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|
| 87 | |
---|
| 88 | #----------------------------------------------------------------------------------- |
---|
| 89 | # Tools to generate png files |
---|
| 90 | # to create a png we create a pdf and convert it to png |
---|
| 91 | %.png : build/%.pstex figures/%.tex ${Build} |
---|
| 92 | echo ${basename $@} |
---|
| 93 | ${LaTeX} figures/${basename $@}.tex |
---|
| 94 | dvips build/${basename $@}.dvi -o build/${basename $@}.ps |
---|
| 95 | ps2pdf build/${basename $@}.ps |
---|
| 96 | convert -negate ${basename $@}.pdf $@ |
---|
| 97 | |
---|
| 98 | # creating a pdf of a figure requires generating some latex that just includes the figure |
---|
| 99 | figures/%.tex: build/%.pstex ${Build} |
---|
| 100 | echo -n "\documentclass[preview]{standalone}\n" \ |
---|
| 101 | "\usepackage[T1]{fontenc}\n" \ |
---|
| 102 | "\usepackage[usenames]{color}\n" \ |
---|
| 103 | "\usepackage{graphicx}\n" \ |
---|
| 104 | "\usepackage{listings}\n" \ |
---|
| 105 | "\usepackage{xspace}\n" \ |
---|
| 106 | "\input{style}\n" \ |
---|
| 107 | "\\\\begin{document}\n" \ |
---|
| 108 | "{\\\\resizebox{3\\\\textwidth}{!}{\input{${basename ${notdir $@}}.pstex_t}}}\n" \ |
---|
| 109 | "\end{document}" > $@ |
---|
| 110 | |
---|
| 111 | # Local Variables: # |
---|
| 112 | # compile-command: "make" # |
---|
| 113 | # End: # |
---|