-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
51 lines (41 loc) · 1.04 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
#######
#
# Auto-generate the CV/resume pdf and clean up latex crap
#
# Author: Joao Moreira
#
######
# Name of resume file with pdf extension instead of tex
RESUME = resume.pdf
# LaTeX input files
RESUME_DIR = ./sections
RESUME_INPUTS = $(wildcard $(RESUME_DIR)/*.tex)
# Tools
LATEXMK = latexmk
XELATEX = -xelatex
# We need to exclude `recorder` option because otherwise latexmk seems to ignore
# changes in files passed as \input{} to $RESUME
LATEXMKOPT = -recorder- -silent
RM = rm -f
.PHONY: decrap clean
all: $(RESUME)
# Compile the resume tex file
$(RESUME): %.pdf:%.tex $(RESUME_INPUTS)
$(LATEXMK) $(LATEXMKOPT) $(XELATEX) $<
@echo
@echo "Successfully compiled $@!"
@echo
# Remove all latex temporary files
decrap:
$(LATEXMK) $(LATEXMKOPT) -c
cd $(RESUME_DIR) && $(LATEXMK) $(LATEXMKOPT) -c
$(RM) *.synctex.gz *.xdv
@echo
@echo "Removed latex temporary files."
@echo
# Remove all auto-generated pdfs in addition to the latex temporary files
clean: decrap
$(LATEXMK) $(LATEXMKOPT) -C
@echo
@echo "Removed all compiled pdf files."
@echo