-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (30 loc) · 1.29 KB
/
Makefile
File metadata and controls
42 lines (30 loc) · 1.29 KB
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
# Some variables
NAME=CARPENTIER
TYPST?=typst
PDF_VIEWER?=evince
THEME_DIR:=$(CURDIR)/theme
# discover sources and map to targets
CV_SRCS:=$(wildcard cv.*.typ)
COVER_SRCS:=$(wildcard cover.*.typ)
# Typst build from root cv.<lang>.typ files
TYP_PDFS:=$(patsubst cv.%.typ,CV_$(NAME)_%.pdf,$(CV_SRCS))
# Typst build from root cover.<lang>.typ files
CL_PDFS:=$(patsubst cover.%.typ,CL_$(NAME)_%.pdf,$(COVER_SRCS))
# single entry-point target builds all PDFs (CV + cover)
all: $(TYP_PDFS) $(CL_PDFS)
# explicit mapping of source -> target using pattern rules
CV_$(NAME)_%.pdf: cv.%.typ img/* *.typ
$(TYPST) compile --root "$(CURDIR)" --package-cache-path "$(THEME_DIR)" --font-path fonts/ $< $@
CL_$(NAME)_%.pdf: cover.%.typ img/* *.typ
$(TYPST) compile --root "$(CURDIR)" --package-cache-path "$(THEME_DIR)" --font-path fonts/ $< $@
# cleaning
clean:
rm -f *.pdf
# watch for changes and rebuild automatically
watch:
@echo "Usage: make watch-cv-<lang> or watch-cover-<lang>"
watch-cv-%:
$(TYPST) watch --root "$(CURDIR)" --package-cache-path "$(THEME_DIR)" --font-path fonts/ --open $(PDF_VIEWER) cv.$*.typ CV_$(NAME)_$*.pdf
watch-cover-%:
$(TYPST) watch --root "$(CURDIR)" --package-cache-path "$(THEME_DIR)" --font-path fonts/ --open $(PDF_VIEWER) cover.$*.typ CL_$(NAME)_$*.pdf
.PHONY: clean all watch