-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (63 loc) · 2.48 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
# BASE PDF FILES
LATEX_COMPILER = lualatex
# Default rule
#all: 1pp 2pp 4pp 6pp TPGit CheatSheets
#2pp doesn't work well for slides.
all: 1pp 4pp 6pp 8pp TPGit slides/slides.pdf #PDFs/git_bash_markdown-2pp.pdf
base = slides/slides.pdf
base: ${base}
slides/slides.pdf: slides/slides.tex images slides/CM-preamble.sty
cd slides; $(LATEX_COMPILER) -shell-escape -interaction=nonstopmode slides.tex
# IMAGES
images: $(patsubst images/%.svg,images/%.pdf,$(wildcard images/*.svg))
images/%.pdf: images/%.svg
inkscape --export-type=pdf "$@" "$<"
###Commented out 2021.1.13###
##CheatSheets: PDFs/git_bash_markdown.pdf
#PDFs/git_bash_markdown-2pp.pdf: PDFs/git_bash_markdown.pdf
# cd PDFs; $(LATEX_COMPILER) CM-handouts-2pp.tex git_bash_markdown.pdf
# mv PDFs/CM-handouts-2pp.pdf PDFs/git_bash_markdown-2pp.pdf
TPGit: TPGit/TPGit.pdf PDFs/TPGit-2pp.pdf
TPGit/TPGit.pdf: TPGit/TPGit.tex images
cd TPGit; $(LATEX_COMPILER) -shell-escape -interaction=nonstopmode TPGit.tex
PDFs/TPGit-2pp.pdf: TPGit/TPGit.pdf
cd PDFs; cp ../TPGit/TPGit.pdf . ; $(LATEX_COMPILER) CM-handouts-2pp.tex TPGit.pdf
mv PDFs/CM-handouts-2pp.pdf PDFs/TPGit-2pp.pdf
# PDFs
# 1 slide / page
1pp = $(addprefix PDFs/,$(filter %.pdf,$(subst /, ,${base})))
1pp: ${1pp}
2pp: $(patsubst %.pdf,%-handouts-2pp.pdf,${1pp})
# 4 slides / page
4pp: $(patsubst %.pdf,%-handouts-4pp.pdf,${1pp})
# 6 slides / page
6pp: $(patsubst %.pdf,%-handouts-6pp.pdf,${1pp})
8pp: $(patsubst %.pdf,%-handouts-8pp.pdf,${1pp})
# Where to search for PDF files in the following rules
vpath %.pdf $(wildcard slides*)
PDFs/%-handouts-2pp.pdf: %.pdf
cd PDFs; $(LATEX_COMPILER) CM-handouts-2pp.tex "$(shell basename "$<")"
mv PDFs/CM-handouts-2pp.pdf "$@"
PDFs/%-handouts-4pp.pdf: %.pdf
cd PDFs; $(LATEX_COMPILER) CM-handouts-4pp.tex "$(shell basename "$<")"
mv PDFs/CM-handouts-4pp.pdf "$@"
PDFs/%-handouts-6pp.pdf: %.pdf
cd PDFs; $(LATEX_COMPILER) CM-handouts-6pp.tex "$(shell basename "$<")"
mv PDFs/CM-handouts-6pp.pdf "$@"
PDFs/%-handouts-8pp.pdf: %.pdf
cd PDFs; $(LATEX_COMPILER) CM-handouts-8pp.tex "$(shell basename "$<")"
mv PDFs/CM-handouts-8pp.pdf "$@"
PDFs/%.pdf: %.pdf
cp "$<" "$@"
#PDFs/slides.pdf: slides.pdf
# cp "$<" "$@"
clean:
rm -fv images/*.pdf
#rm -fv PDFs/*.pdf PDFs/*.log PDFs/*.aux
rm -fv PDFs/*.log PDFs/*.aux
rm -rfv CM*/*_minted-*
rm -fv slides/slides.pdf slides/*.log slides/*.aux slides/*.nav slides/*.snm slides/*.toc slides/*.vrb
clean-all-pdfs: clean
rm -fv PDFs/*.pdf
# Rules that do not represent a file
.PHONY: base 1pp 2pp 4pp 6pp 8pp clean