1 | # Configuration variables |
---|
2 | |
---|
3 | Build = build |
---|
4 | Figures = figures |
---|
5 | Pictures = pictures |
---|
6 | |
---|
7 | TeXSRC = ${wildcard *.tex} |
---|
8 | FigSRC = ${notdir ${wildcard ${Figures}/*.fig}} |
---|
9 | PicSRC = ${notdir ${wildcard ${Pictures}/*.fig}} |
---|
10 | BibSRC = ${wildcard *.bib} |
---|
11 | |
---|
12 | TeXLIB = .:../../LaTeXmacros:${Build}: # common latex macros |
---|
13 | BibLIB = .:../../bibliography # common citation repository |
---|
14 | |
---|
15 | MAKEFLAGS = --no-print-directory # --silent |
---|
16 | VPATH = ${Build} ${Figures} ${Pictures} # extra search path for file names used in document |
---|
17 | |
---|
18 | DOCUMENT = uw-ethesis.pdf |
---|
19 | BASE = ${basename ${DOCUMENT}} # remove suffix |
---|
20 | |
---|
21 | # Commands |
---|
22 | |
---|
23 | LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=${Build} |
---|
24 | BibTeX = BIBINPUTS=${BibLIB} && export BIBINPUTS && bibtex |
---|
25 | #Glossary = INDEXSTYLE=${Build} makeglossaries-lite |
---|
26 | |
---|
27 | # Rules and Recipes |
---|
28 | |
---|
29 | .PHONY : all clean # not file names |
---|
30 | .PRECIOUS: %.dvi %.ps # do not delete intermediate files |
---|
31 | .ONESHELL : |
---|
32 | |
---|
33 | all : ${DOCUMENT} |
---|
34 | |
---|
35 | clean : |
---|
36 | @rm -frv ${DOCUMENT} ${Build} |
---|
37 | |
---|
38 | # File Dependencies |
---|
39 | |
---|
40 | %.dvi : ${TeXSRC} ${FigSRC:%.fig=%.tex} ${PicSRC:%.fig=%.pstex} ${BibSRC} Makefile | ${Build} |
---|
41 | ${LaTeX} ${BASE} |
---|
42 | ${BibTeX} ${Build}/${BASE} |
---|
43 | ${LaTeX} ${BASE} |
---|
44 | # if needed, run latex again to get citations |
---|
45 | if fgrep -s "LaTeX Warning: Citation" ${basename $@}.log ; then ${LaTeX} ${BASE} ; fi |
---|
46 | # ${Glossary} ${Build}/${BASE} |
---|
47 | # ${LaTeX} ${BASE} |
---|
48 | |
---|
49 | ${Build}: |
---|
50 | mkdir -p $@ |
---|
51 | |
---|
52 | %.pdf : ${Build}/%.ps | ${Build} |
---|
53 | ps2pdf $< |
---|
54 | |
---|
55 | %.ps : %.dvi | ${Build} |
---|
56 | dvips $< -o $@ |
---|
57 | |
---|
58 | %.tex : %.fig | ${Build} |
---|
59 | fig2dev -L eepic $< > ${Build}/$@ |
---|
60 | |
---|
61 | %.ps : %.fig | ${Build} |
---|
62 | fig2dev -L ps $< > ${Build}/$@ |
---|
63 | |
---|
64 | %.pstex : %.fig | ${Build} |
---|
65 | fig2dev -L pstex $< > ${Build}/$@ |
---|
66 | fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t |
---|