diff options
| author | Matthieu Pignolet <matthieu@puffer.fish> | 2025-05-11 18:54:00 +0400 |
|---|---|---|
| committer | Matthieu Pignolet <matthieu@puffer.fish> | 2025-05-11 18:54:00 +0400 |
| commit | 22e00afb683cf8b3cd0bc2b81aa757f36686312b (patch) | |
| tree | b18e44c917766610c365c47cc35345c2f95085d8 | |
| parent | a83cd1ddf0653dc0b49769eea757fe76b19c27c6 (diff) | |
feat: added build system for LaTeX files
| -rw-r--r-- | Makefile | 21 |
1 files changed, 21 insertions, 0 deletions
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 |
