chore: add makefile

This commit is contained in:
eggy 2025-01-07 15:32:22 -05:00
parent cdd0b8e201
commit 37e7f86319

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# Define the source .typ files and the target PDF names
TYP_FILES := $(wildcard *.typ)
PDF_FILES := $(TYP_FILES:.typ=.pdf)
PREFIXED_PDFS := $(addprefix danielchen_, $(PDF_FILES))
# Rule to build all PDFs with the "danielchen_" prefix
all: $(PREFIXED_PDFS)
danielchen_%.pdf: %.typ
typst compile $< $@
# Rule for watching all .typ files concurrently
watch:
@$(foreach file, $(TYP_FILES), \
(typst watch $(file) danielchen_$(basename $(file)).pdf &) ; \
)
@wait
# Cleanup rule
clean:
rm -f danielchen_*.pdf