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