generated from chujimmy/cv_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (47 loc) · 1.57 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
define check_lang
@t=$(LANG); \
if [ $${#t} -ne 2 ]; then \
echo "Invalid lang: $$t length is not 2 characters"; \
false; \
fi
endef
.PHONY: start
start:
docker image prune -f
docker-compose up --force-recreate
.PHONY: stop
stop:
docker-compose down
.PHONY: clean
clean:
find . -name '*.aux' -delete -o -name '*.fdb_latexmk' -delete -o -name '*.fls' -delete -o -name '*.log' -delete -o -name '*.out' -delete -o -name '.DS_Store' -delete
.PHONY: clean-pdf
clean-pdf:
find src -name '*.pdf' -delete
.PHONY: clean-all
clean-all: clean clean-pdf
LANG_LOWER = $(shell echo $(LANG) | tr A-Z a-z)
.PHONY: add-cv
add-cv:
$(call check_lang)
mkdir ./src/cv/lang/$(LANG_LOWER)/
cp -a ./src/template/cv/. ./src/cv/lang/$(LANG_LOWER)/
docker exec cv bash -c -i "latexmk -pdf -pvc -file-line-error -view=none -interaction=nonstopmode -recorder -cd /data/cv/src/cv/lang/$(LANG_LOWER)/cv.tex > /proc/1/fd/1 2>/proc/1/fd/2 &"
.PHONY: remove-cv
remove-cv:
$(call check_lang)
rm -rf ./src/cv/lang/$(LANG_LOWER)/
.PHONY: add-letter
add-letter:
$(call check_lang)
mkdir ./src/letter/lang/$(LANG_LOWER)/
cp -a ./src/template/letter/. ./src/letter/lang/$(LANG_LOWER)/
docker exec cv bash -c -i "latexmk -pdf -pvc -file-line-error -view=none -interaction=nonstopmode -recorder -cd /data/cv/src/letter/lang/$(LANG_LOWER)/letter.tex > /proc/1/fd/1 2>/proc/1/fd/2 &"
.PHONY: remove-letter
remove-letter:
$(call check_lang)
rm -rf ./src/letter/lang/$(LANG_LOWER)/
.PHONY: add-lang
add-lang: add-cv add-letter
.PHONY: remove-lang
remove-lang: remove-cv remove-letter