diff options
| author | Matthieu Pignolet <matthieu@puffer.fish> | 2025-05-11 19:45:25 +0400 |
|---|---|---|
| committer | Matthieu Pignolet <matthieu@puffer.fish> | 2025-05-11 19:45:25 +0400 |
| commit | b56db32779a1b63e21fd610c97715f10acd3654a (patch) | |
| tree | ad5f493cf441739f5b51d09562c1428e45ff4074 | |
| parent | bc89c7f15cac40852d5e906f30c2036cd47585e9 (diff) | |
feat: add options to the makefile and update the watch script to use them
| -rw-r--r-- | Makefile | 15 | ||||
| -rwxr-xr-x | watch.sh | 2 |
2 files changed, 10 insertions, 7 deletions
@@ -1,5 +1,8 @@ TEX := $(wildcard *.tex) NAMES := $(TEX:.tex=.pdf) +TEX2PDF := xelatex +TEXFLAGS := +TEMPSUFFIX := tex # Target that matches all possible generated PDFs all: $(NAMES) @@ -7,19 +10,19 @@ $(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)) + $(eval TMP := $(shell mktemp -d --suffix=$(TEMPSUFFIX))) @cp -r * $(TMP)/ cd $(TMP)/; \ - xelatex $<; + $(TEX2PDF) $(TEXFLAGS) $<; @cp $(TMP)/$@ $@ - @rm -rf $(TMP) + @$(RM) -r $(TMP) # Rule that cleans all previous content clean: - @rm *.pdf - @rm -r /tmp/*-sts-build + @$(RM) *.pdf + @$(RM) -r /tmp/*$(TEMPSUFFIX) watch: watch.sh ./watch.sh -.PHONY: all clean watch
\ No newline at end of file +.PHONY: all clean watch @@ -12,6 +12,6 @@ inotifywait -r -m -e modify . | then name="${file_name%%.*}" # We call the make target in order to build it - make "$name.pdf" + make "$name.pdf" TEXFLAGS=--halt-on-error fi done |
