From 22e00afb683cf8b3cd0bc2b81aa757f36686312b Mon Sep 17 00:00:00 2001 From: Matthieu Pignolet Date: Sun, 11 May 2025 18:54:00 +0400 Subject: feat: added build system for LaTeX files --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ab5803b --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +TEX := $(wildcard *.tex) +NAMES := $(TEX:.tex=.pdf) + +# Target that matches all possible generated PDFs +all: $(NAMES) +$(NAMES): $(%:.pdf=.tex) + +# Rule that builds the tex file in a temp directory and copies it +%.pdf: %.tex + $(eval TMP := $(shell mktemp -d --suffix=-sts-build)) + @cp -r * $(TMP)/ + cd $(TMP)/; \ + xelatex $<; + @cp $(TMP)/$@ $@ + @rm -rf $(TMP) + +# Rule that cleans all previous content +clean: + @rm *.pdf + @rm -r /tmp/*-sts-build +.PHONY: all clean \ No newline at end of file -- cgit v1.2.3