From 37e7f86319a4520cb9e5d4542c17d53dc7a6aea5 Mon Sep 17 00:00:00 2001 From: eggy Date: Tue, 7 Jan 2025 15:32:22 -0500 Subject: [PATCH] chore: add makefile --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a5735c3 --- /dev/null +++ b/Makefile @@ -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