-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (50 loc) · 2.21 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
# ---------------------------------------------------------------------------
# This makefile compiles a LaTeX altacv resume and provides various quality
# of life options.
#
# Written by Klaire Curde
# ---------------------------------------------------------------------------
sources := kcurde.tex sidebar.tex altacv.cls
output_file := kcurde.pdf
pretty_file := Klaire_Curde_resume.pdf
pretty_file_dead := Curde_Klaus_Resume.pdf
name1 := KLAIRE
name2 := KLAUS
# Function to replace a string with another across all sources.
replace_name = \
for file in $(sources) ; do \
sed -i 's/$(1)/$(2)/g' $$file ; \
done
## : Compiles all files.
${output_file}: ${sources}
latexindent -l ./localSettings.yaml -w ${sources}
#$(word 1,$(sources)) # Accesses only first file
latexmk -pdf $(word 1,$(sources))
pretty: ## Compiles all files and generates a copy with a pretty name.
latexindent -w ${sources}
latexmk -pdf $(word 1,$(sources))
cp ${output_file} ${pretty_file}
dead: ## Compiles all files and generates a copy with a dead name/change.
$(call replace_name,name1,name2)
latexmk -pdf $(word 1,$(sources))
cp ${output_file} ${pretty_file_dead}
$(call replace_name,name2,name1)
format: ## Formats all sources with latexmk.
latexindent -l ./localSettings.yaml -w ${sources}
clean: ## Removes all extraneous files.
rm -f *.bcf *.run.xml *.synctex.gz *.out *.fls *.fdb_latexmk *.log *.blg *.bbl *.aux *.bak?
nuke: ## Removes all compiled and extraneous files.
rm -f ${output_file} ${pretty_file} ${pretty_file_dead} *.pdf
rm -f *.bcf *.run.xml *.synctex.gz *.out *.fls *.fdb_latexmk *.log *.blg *.bbl *.aux *.bak?
define help_text
-------------------------------------------------------------------------------
| This makefile compiles a LaTeX altacv resume and provides various quality |
| of life options including text substitution. |
| |
| Written by Klaire Curde. |
-------------------------------------------------------------------------------
endef
export help_text
help: ## Show this help.
@echo "$$help_text"
@sed -ne '/@sed/!s/## //p' $(MAKEFILE_LIST) | column -tl 2