-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
105 lines (80 loc) · 2.92 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
pdflatex := /Library/TeX/texbin/pdflatex
xelatex := /Library/TeX/texbin/xelatex
tlmgr := /Library/TeX/texbin/tlmgr
resume_pkgs := ucs sectsty helvetic catchfile kpathsea etoolbox
letter_pkgs := enumitem xifthen ifmtarg fontspec fontawesome sourcesanspro tcolorbox environ trimspaces
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: build_resume build_cv ## Builds resume and CV PDF
.PHONY: build_resume
build_resume: ## Builds resume PDF
$(pdflatex) *resume.tex
.PHONY: build_cv
build_cv: ## Builds curriculum vitae PDF
env CV=true $(pdflatex) -jobname=cv *resume.tex
.PHONY: build_letter
build_letter: ## Builds letter PDF
$(xelatex) letter.tex
.PHONY: watch_resume
watch_resume: ## Rebuilds resume on changes
@watcher -cmd="xargs $(pdflatex) -interaction=nonstopmode" -keepalive -pipe *resume.tex
.PHONY: watch_cv
watch_cv: ## Rebuilds curriculum vitae on changes
@watcher -cmd="xargs env CV=true $(pdflatex) -jobname=cv -interaction=nonstopmode" -keepalive -pipe *resume.tex
.PHONY: watch_letter
watch_letter: ## Rebuilds letter on changes
@watcher -cmd="xargs $(xelatex) -interaction=nonstopmode" -keepalive -pipe *letter.tex
.PHONY: versions
versions: ## Shows installed versions of dependencies
$(pdflatex) -version
@printf "\n"
$(xelatex) -version
@printf "\n"
watcher -version
.PHONY: install
install: get_basictex get_latex_pkgs get_watcher ## Installs dependencies
.PHONY: get_watcher
get_watcher:
@curl -sSL https://github.com/dideler/watcher/releases/latest/download/watcher_macOS_64-bit.tar.gz > watcher.tar.gz
@tar --gzip -xvf watcher.tar.gz --directory ~/bin &>/dev/null
@rm watcher.tar.gz
@echo "installed watcher $(shell watcher -version)"
.PHONY: get_basictex
get_basictex:
@brew install basictex --cask
.PHONY: get_latex_pkgs
get_latex_pkgs: get_resume_latex_pkgs get_letter_latex_pkgs
.PHONY: get_resume_latex_pkgs
get_resume_latex_pkgs:
@sudo $(tlmgr) install $(resume_pkgs)
.PHONY: get_letter_latex_pkgs
get_letter_latex_pkgs:
@sudo $(tlmgr) install $(letter_pkgs)
.PHONY: update_latex_pkgs
update_latex_pkgs:
@sudo $(tlmgr) update --list
@sudo $(tlmgr) update --self --all
.PHONY: search_latex_pkgs
search_latex_pkgs:
@sudo $(tlmgr) info --list $(ARGS)
.PHONY: uninstall
uninstall: uninstall_watcher uninstall_latex_pkgs uninstall_basictex ## Uninstalls dependencies (!)
.PHONY: uninstall_basictex
uninstall_basictex:
@brew uninstall basictex --cask
.PHONY: uninstall_watcher
uninstall_watcher:
@test -f ~/bin/watcher && rm ~/bin/watcher
.PHONY: uninstall_latex_pkgs
uninstall_latex_pkgs: uninstall_resume_pkgs uninstall_letter_pkgs
.PHONY: uninstall_resume_pkgs
uninstall_resume_pkgs:
@sudo $(tlmgr) uninstall $(resume_pkgs)
.PHONY: uninstall_letter_pkgs
uninstall_letter_pkgs:
@sudo $(tlmgr) uninstall $(letter_pkgs)
.PHONY: clean
clean: ## Cleans generated files
rm *.pdf *.aux *.log *.out