summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 27 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index c8978ef..caacf54 100644
--- a/Makefile
+++ b/Makefile
@@ -1,28 +1,27 @@
-TEX := $(wildcard *.tex)
-NAMES := $(TEX:.tex=.pdf)
-TEX2PDF := xelatex
-TEXFLAGS :=
-TEMPSUFFIX := tex
-
-# 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 TEMP := $(shell mktemp -d --suffix=$(TEMPSUFFIX)))
- @cp -r * $(TEMP)/
- cd $(TEMP)/; \
- $(TEX2PDF) $(TEXFLAGS) $<;
- @cp $(TEMP)/$@ $@
- @$(RM) -r $(TEMP)
-
-# Rule that cleans all previous content
-clean:
- @$(RM) *.pdf
- @$(RM) -r /tmp/*$(TEMPSUFFIX)
-
-watch: watch.sh
- ./watch.sh
-
-.PHONY: all clean watch
+TEX := $(wildcard *.tex)
+NAMES := $(TEX:.tex=.pdf)
+LATEXMK := latexmk
+CHKTEX := chktex
+TEXFLAGS := -pdf -r "./latexmk/glossaries.latexmk"
+TEMPSUFFIX := tex
+TEX_FILES = $(shell find . -type f -name '*.tex')
+
+# 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 $(TEX_FILES)
+ $(LATEXMK) $(TEXFLAGS) $<
+
+check-%.txt: %.tex $(TEX_FILES)
+ $(CHKTEX) $< | tee $@;
+
+# Rule that cleans all previous content
+clean:
+ @$(RM) *.pdf
+
+watch: watch.sh
+ ./watch.sh
+
+.PHONY: all clean watch \ No newline at end of file