-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
85 lines (67 loc) · 3.43 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# ┌───────────────────────────────────────────────────────────────┐
# │ Contents of Makefile │
# ├───────────────────────────────────────────────────────────────┘
# │
# ├── FLAGS
# ├──┐COMMANDS
# │ ├── DEFAULT
# │ ├── MULTIPLE FILES + CLEAN
# │ ├── SINGLE FILES + CLEAN
# │ └── BASE COMMANDS
# │
# └───────────────────────────────────────────────────────────────
# ################################################################ FLAGS
# compilation software
engine=lualatex
# options for biber compilation
flagsBib=--quiet
# options for all latex compilations
#flagsBase=--interaction=nonstopmode --file-line-error --recorder
flagsBase=--interaction=nonstopmode --file-line-error
# options for intermediate latex compilations
flagsDraft=--draftmode
# options for the final latex compilation
#flagsFinal=--synctex=1
flagsFinal=
# options for log filter
#flagsLog=--full-log
flagsLog=
# ################################################################ COMMANDS
# ################################ DEFAULT
.DEFAULT_GOAL := thesis
# ################################ MULTIPLE FILES + CLEAN
all: thesis-only presentation-only end
# ################################ SINGLE FILES + CLEAN
cover: cover-digital cover-printed cover-printed-spine end
presentation: presentation-only end
thesis: thesis-only end
part: part-only end
end: clean success
# ################################ BASE COMMANDS
presentation-only:
# 2 passes are needed for toc and correct positioning of background pictures
$(engine) $(flagsBase) $(flagsDraft) "presentation.tex" | texlogfilter $(flagsLog)
# uncomment biber if you have references
#biber $(flagsBib) "presentation.bcf"
$(engine) $(flagsBase) $(flagsFinal) "presentation.tex" | texlogfilter $(flagsLog)
thesis-only:
# 1+1+2 passes are needed for proper hyperlinks and references destinations
$(engine) $(flagsBase) $(flagsDraft) "thesis.tex" | grep -vE "(LaTeX Warning: Citation|LaTeX Warning: Empty bibliography|LaTeX Warning: Reference|Package acronym Warning:|Package biblatex Warning:|Package tagpdf Warning:|\(tagpdf\))" | texlogfilter $(flagsLog)
biber $(flagsBib) "thesis.bcf"
$(engine) $(flagsBase) $(flagsDraft) "thesis.tex" | grep -vE "(Package tagpdf Warning:|\(tagpdf\))" | texlogfilter $(flagsLog)
$(engine) $(flagsBase) $(flagsFinal) "thesis.tex" | grep -vE "(Package tagpdf Warning:|\(tagpdf\))" | texlogfilter $(flagsLog)
part-only:
$(engine) $(flagsBase) $(flagsFinal) "extra/part.tex" | texlogfilter $(flagsLog)
cover-digital:
$(engine) $(flagsBase) $(flagsFinal) "extra/cover-digital.tex" | texlogfilter $(flagsLog)
mv cover-digital.pdf pages/
cover-printed:
$(engine) $(flagsBase) $(flagsFinal) "extra/cover-printed.tex" | texlogfilter $(flagsLog)
mv cover-printed.pdf pages/
cover-printed-spine:
$(engine) $(flagsBase) $(flagsFinal) "extra/cover-printed-spine.tex" | texlogfilter $(flagsLog)
mv cover-printed-spine.pdf pages/
clean:
git clean -Xfdq
success:
echo "[OK] The operation completed successfully"