-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
124 lines (92 loc) · 3.36 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
## Config global
LATEXMK = latexmk $(LATEXMKRC_FLAGS) -f -pdf -silent -diagnostics
XELATEX_OPT := -e '$$pdflatex=q/xelatex -synctex=1 %O %S/'
## Config project
GFX_OUT_DIR := gfx-out
GFX_DIR := gfx
THESIS_CHAPTERS := \
01_introduction/introduction.tex \
02_analysis/analysis.tex \
03_design/design.tex \
04_implementation/implementation.tex \
05_testing/testing.tex \
06_conclusion/conclusion.tex \
appendix/appendix.tex
THESIS_META := meta/title.tex meta/committee.tex
THESIS_DEP := 00_front-matter/abstract.tex 00_front-matter/acknowledgements.tex 00_front-matter/notation.tex \
preamble/helper.tex thesis.bib \
$(THESIS_META) $(THESIS_CHAPTERS)
PRESENT_DEP := preamble/present-helper.tex meta/defense.tex
GFX_DEP := \
$(GFX_OUT_DIR)/matlab-call-graph/segmentation.tex \
$(GFX_OUT_DIR)/matlab-call-graph/registration.tex \
$(GFX_OUT_DIR)/matlab-call-graph/tracing.tex \
$(GFX_DIR)/sdlc.tex \
$(GFX_DIR)/algorithm/*.tex
## Rules
MINIMAL_TARGETS := thesis.pdf present.pdf
NOTES_TARGETS := note/experimental.pdf note/biblio.pdf note/algorithm.pdf note/test.pdf
PRESENT_EXTRA_TARGETS := present-note.pdf present-article.pdf present-handout-2x3.pdf
ALL_TARGETS := $(MINIMAL_TARGETS) $(PRESENT_EXTRA_TARGETS) $(NOTES_TARGETS)
all: $(ALL_TARGETS) tags
minimal: $(MINIMAL_TARGETS)
notes: $(NOTES_TARGETS)
thesis.pdf: thesis.tex $(THESIS_DEP) $(GFX_DEP)
algorithm.pdf: algorithm.tex $(THESIS_DEP)
note/test.pdf: LATEXMKRC_FLAGS += $(XELATEX_OPT)
# this will fail unless the presentation uses \note{...}
present-note.pdf: LATEXMKRC_FLAGS += -jobname=present-note $(XELATEX_OPT)
present-note.pdf: present.tex $(PRESENT_DEP)
-$(LATEXMK) '\def\printpresentnote{} \input $<'
present-article.pdf: LATEXMKRC_FLAGS += -jobname=present-article $(XELATEX_OPT)
present-article.pdf: present.tex $(PRESENT_DEP)
-$(LATEXMK) '\def\printpresentarticle{} \input $<'
present-handout.pdf: LATEXMKRC_FLAGS += -jobname=present-handout $(XELATEX_OPT)
present-handout.pdf: present.tex $(PRESENT_DEP)
-$(LATEXMK) '\def\printpresenthandout{} \input $<'
present.pdf: LATEXMKRC_FLAGS += $(XELATEX_OPT)
present.pdf: present.tex $(PRESENT_DEP)
present-handout-2x3.pdf: present-handout.pdf
pdfjam-slides6up --suffix '2x3' --batch $<
note/%.pdf: note/%.tex
-$(LATEXMK) --outdir=note $<
%.pdf: %.tex
-$(LATEXMK) $<
%.tex: %.md
pandoc -t latex $< -o $@
$(GFX_OUT_DIR):
mkdir -p $(GFX_OUT_DIR)
$(GFX_OUT_DIR)/%.tex : gfx/%.dot
mkdir -p `dirname $@`
dot2tex --format tikz --figonly < $< > $@
tags:
ctags -R .
include ~/sw_projects/zmughal/scraps/scraps/build/latex/clean.mk
wc-pdf: thesis.pdf
pdftotext thesis.pdf - | wc -w
wc-tex:
find -name '*.tex' | xargs wc -w
cleanall::
rm -Rf $(ALL_TARGETS)
rm -Rf $(GFX_OUT_DIR)
rm -Rf tags
check:
@echo "Check for references that are not resolved"
@echo "==="
-@pdftotext thesis.pdf - | grep --colour=auto -C1 '??'
-@fgrep "I didn't find a database entry" *.blg
@echo "==="
lacheck thesis.tex
@echo "==="
chktex thesis.tex
latexdiff-thesis:
if [ -z "$(LAST_VERSION)" ]; then \
LTX_COMP=`git tag | tail -1`; \
echo "Using last tag: $$LTX_COMP"; \
else \
LTX_COMP=$(LAST_VERSION); \
fi; \
git latexdiff -v --output diff.pdf --ignore-latex-errors --main thesis.tex $$LTX_COMP master
dep-debian:
sudo apt-get install --no-install-recommends $$( sed 's/#.*$$//g' < debian-packages )
.PHONY: all minimal notes wc-pdf wc-tex check latexdiff-thesis dep-debian