-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
56 lines (41 loc) · 1.31 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
# Makefile to make all the PDF files needed
# Main Latex source file
MAIN = example.tex
# Lectures
LECTURES = 01
# Cleaning
CLEAN=.aux .log .nav .out .snm .toc .vrb .synctex.gz .pyc .bbl .blg .idx .fls .fdb_latexmk
# Latex to use
LATEX=lualatex
# Default target
default : current
# Current
current : $(MAIN)
$(LATEX) "$(MAIN)"
grep -q "rerunfilecheck Warning" "[email protected]" && $(LATEX) "$(MAIN)"
# All
all : slides handouts
# All slides
slides : $(addprefix slides-, $(LECTURES))
# All handouts
handouts : $(addprefix handout-, $(LECTURES))
# Individual slides
slides-% : $(MAIN)
$(LATEX) -jobname "$@" "\def\uselecture{$*}\input{$(MAIN)}"
grep -q "rerunfilecheck Warning" "[email protected]" && $(LATEX) -jobname "$@" "\def\uselecture{$*}\input{$(MAIN)}"
@mkdir -p slides
@mv -f "[email protected]" slides
@rm -f $(addprefix $@, $(CLEAN))
# Individual slides
handout-% : $(MAIN)
$(LATEX) -jobname "$@" "\def\uselecture{$*}\PassOptionsToClass{handout}{beamer}\input{$(MAIN)}"
grep -q "rerunfilecheck Warning" "[email protected]" && $(LATEX) -jobname "$@" "\def\uselecture{$*}\PassOptionsToClass{handout}{beamer}\input{$(MAIN)}"
@mkdir -p handouts
@mv -f "[email protected]" handouts
@rm -f $(addprefix $@, $(CLEAN))
# Other targets
clean :
@rm -f $(addprefix *, $(CLEAN))
remake : cleanpdf all
dummy : ;
.PHONY : default all lectures clean cleanpdf remake dummy