summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rwxr-xr-xwatch.sh2
2 files changed, 10 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 1671523..1266971 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/watch.sh b/watch.sh
index c591037..d5a09f1 100755
--- a/watch.sh
+++ b/watch.sh
@@ -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