-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (42 loc) · 1.37 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
FILENAME = main
date = $(shell date +%Y-%m-%d)
output_file = 2022-09-13.pdf
figure_src = $(wildcard figures/*.svg figures/*/*.svg figures/*.tex figures/*/*.tex)
figure_list = $(patsubst %.svg,%.pdf,$(patsubst %.tex,%.pdf,$(figure_src)))
LATEX = lualatex
# LATEX = pdflatex
BIBTEX = bibtex
default: document
figures: $(figure_list)
figures/%.pdf: figures/%.svg
inkscape -z -D --file=$(basename $@).svg --export-pdf=$(basename $@).pdf
# Target assumes figure source is in same directory as expected figure path
figures/%.pdf: figures/%.tex
latexmk -$(LATEX) -interaction=nonstopmode -halt-on-error $(basename $@)
mv $(notdir $(basename $@)).pdf $(basename $@).pdf
rm $(notdir $(basename $@)).*
slides: figures
latexmk -$(LATEX) -shell-escape -logfilewarnings -halt-on-error $(FILENAME)
document: slides
rsync $(FILENAME).pdf $(output_file)
rsync $(FILENAME).pdf draft_$(date).pdf
ci:
latexmk -$(LATEX) -shell-escape -logfilewarnings -halt-on-error $(FILENAME)
clean:
rm -f *.aux *.bbl *.blg *.dvi *.idx *.lof *.log *.lot *.toc \
*.xdy *.nav *.out *.snm *.vrb *.mp \
*.synctex.gz *.brf *.fls *.fdb_latexmk \
*.glg *.gls *.glo *.ist *.alg *.acr *.acn
clean_figures:
rm -f $(figure_list)
clean_drafts:
rm -f draft_*.pdf
realclean: clean clean_figures
rm -f *.ps *.pdf
final:
if [ -f *.aux ]; then \
$(MAKE) clean; \
fi
$(MAKE) figures
$(MAKE) slides
$(MAKE) clean