-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (49 loc) · 2.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# partly autogenerated, that's why it's so ugly!
# say 'make V=1' to see the full build output
ifndef V
Q = @
Q_LATEX = sh -c 'echo -e " " `echo $$(basename "$$0") | tr a-z A-Z`"\t$${!\#/..\/..\//}"; ! "$$0" "$$@" | grep -A5 -E "^[^ ]+:[0-9]+:"'
Q_OTHER = sh -c 'echo -e " " `echo $$(basename "$$0") | tr a-z A-Z`"\t$${!\#/..\/..\//}"; "$$0" "$$@" >/dev/null'
endif
LATEX = latex
PDFLATEX = pdflatex
BIBTEX = bibtex
DVIPS = dvips
DVIPDF = dvipdf
PDFTOEPS = pdftops -eps
PDFTOPS = pdf2ps
EPSTOPDF = epstopdf
FIGTODEV = fig2dev
MPOST = mpost
.PHONY: all clean archive
all: thesis
texfiles = $(wildcard *.tex)
.PHONY: thesis
thesis: thesis.pdf thesis.ps
thesis.pdf: $(texfiles) thesis.bbl
$(Q) rm -rf build/pdf/; mkdir -p build/pdf/
$(Q) cd build/pdf/ && TEXINPUTS="../../:$$TEXINPUTS" $(Q_LATEX) $(PDFLATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex
$(Q) cd build/pdf/ && TEXINPUTS="../../:$$TEXINPUTS" $(Q_LATEX) $(PDFLATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex
$(Q) ln -f build/pdf/thesis.pdf thesis.pdf
thesis.dvi: $(texfiles) thesis.bbl
$(Q) rm -rf build/dvi/; mkdir -p build/dvi/
$(Q) cd build/dvi/ && TEXINPUTS="../../:$$TEXINPUTS" $(Q_LATEX) $(LATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex
$(Q) cd build/dvi/ && TEXINPUTS="../../:$$TEXINPUTS" $(Q_LATEX) $(LATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex
$(Q) ln -f build/dvi/thesis.dvi thesis.dvi
thesis.ps: thesis.dvi
$(Q)$(Q_OTHER) $(DVIPS) -q thesis
thesis.aux: $(texfiles)
$(Q) $(Q_LATEX) $(LATEX) -interaction=nonstopmode -file-line-error thesis.tex
thesis.bbl: thesis.aux
$(Q)$(Q_OTHER) $(BIBTEX) thesis
clean:
rm -rf build/
rm -f *.aux
rm -f thesis.dvi thesis.idx thesis.ind thesis.ilg thesis.out thesis.toc thesis.pdf thesis.log
archive: thesis-template.zip
thesis-template.zip: *.tex Makefile ETHlogo.* refs.bib
mkdir -p thesis
cp `git ls-files "*.tex" Makefile "ETHlogo.*" refs.bib` thesis/
perl -i -pe 's/\$$VERSION\$$/'"$$(git describe)/" thesis/*.tex
rm -f thesis-template.zip
zip -r thesis-template.zip thesis/