-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·44 lines (32 loc) · 1.11 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
main := thesis
latex := xelatex
bibtex := bibtex
content := $(wildcard chapters/*.tex)
content += $(wildcard frontmatter/*.tex)
content += $(wildcard backmatter/*.tex)
content += $(wildcard backmatter/*.bib)
content += $(wildcard appendices/*.tex)
styles := $(wildcard ./*.sty)
listings := $(wildcard listings/*.c)
backup := $(addsuffix .bak, $(chapters))
backup += $(addsuffix .bak, $(frontmatter))
backup += $(addsuffix .bak, $(appendices))
figures := $(wildcard figures/*.pdf)
figures += $(wildcard figures/*.png)
figures += $(wildcard figures/*.tex)
.PHONY: all clean distclean
AWK=gawk
all: $(main).pdf
$(main).pdf: $(main).tex $(content) $(figures) $(listings) $(styles) preamble.tex
$(AWK) -f sort-abbreviations.awk backmatter/abbreviations.tex > abbreviations-sorted.tex
rm -f $(backup)
${latex} $(main).tex
${bibtex} -terse $(main).aux
${latex} $(main).tex
max_print_line=2048 ${latex} $(main).tex | grep '^[^()]'
clean:
rm -f $(backup)
rm -f $(main).aux $(main).bbl $(main).blg $(main).dvi $(main).log $(main).out $(main).ps $(main).xmpdata
rm -f abbreviations-sorted.tex
distclean: clean
rm -f $(main).pdf