-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (67 loc) · 1.68 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
MAKEFLAGS += --no-print-directory
default: once
once:
$(MAKE) compile && $(MAKE) render
slides:
$(MAKE) slides_short && $(MAKE) render_slides
# latex
compile_tex: thesis.tex
xelatex -shell-escape -interaction=nonstopmode thesis || \
$(MAKE) clean
compile_short: thesis.tex
$(MAKE) compile_tex && \
$(MAKE) copy_pdf
compile: thesis.tex
$(MAKE) compile_tex && \
$(MAKE) compute_bib && \
$(MAKE) compile_short
compile_slides: slides.tex
xelatex -shell-escape -interaction=nonstopmode slides || \
$(MAKE) clean
slides_short: slides.tex
$(MAKE) compile_slides && \
$(MAKE) copy_pdf
slides_long: slides.tex
$(MAKE) compile_slides && \
$(MAKE) compute_bib_slides && \
$(MAKE) slides_short
# pdf
copy_pdf: thesis.pdf
cp thesis.pdf /tmp/thesis.pdf 2>/dev/null
copy_pdf_slides: slides.pdf
cp slides.pdf /tmp/slides.pdf 2>/dev/null
render:
make copy_pdf
zathura /tmp/thesis.pdf
render_slides:
make copy_pdf_slides
zathura /tmp/slides.pdf
pdf: render
# upload
upload:
sscp thesis.pdf u:html/
up:
$(MAKE) compile && \
$(MAKE) copy_pdf && \
$(MAKE) upload
# bibliography
compute_bib:
biber thesis
compute_bib_slides:
biber slides
import_bib:
/bin/pubs -c ~/projects/uni/z_ba/pubs/pubsrc export >bibliography.bib
$(MAKE) compute_bib
bib: import_bib
# watch
watch: recompile rerender
recompile: thesis.tex
ls thesis.tex 2>/dev/null | entr -p ./make-if-changed
rerender: thesis.pdf
$(MAKE) copy_pdf
ls /tmp/thesis.pdf | entr -r zathura /tmp/thesis.pdf
recompute: bibliography.bib
ls bibliography.bib | entr -rp $(MAKE) compute_bib
# cleanup
clean:
rm thesis.aux thesis.bcf thesis.lof thesis.lol thesis.lot thesis.run.xml thesis.toc thesis.out *.bbl *.blg *.log _minted-thesis 2>/dev/null