diff --git a/Makefile b/Makefile
index dd6bd79fd634de878e91cd35103984c53c5ce008..1b15d1e20c9acc69f80b3ea67d2290de8895ff4c 100644
--- a/Makefile
+++ b/Makefile
@@ -10,25 +10,25 @@ images:
 images/wide.jpg:| images
 	convert -size 100x60 xc:skyblue -fill white -stroke black  -draw "ellipse 50,30 40,20 45,270" images/wide.jpg
 
-ALL_FILES := $(wildcard *.tex) $(wildcard *.sty) | $(DROSS)
+ALL_FILES := LOCTEX STYLE_FILES | $(DROSS)
 
 .PHONY: test
 test: $(DROSS)/test.pdf
-$(DROSS)/test.pdf: test.tex $(ALL_FILES)
+$(DROSS)/test.pdf: $(ALL_FILES) $(DROSS)
 	$(RUN) test.tex
-	cd $(DROSS) && makeglossaries test
+	$(GLOS) test
 	$(RUN) test.tex
 
-docs.pdf: images/wide.jpg $(ALL_FILES)
+docs.pdf: images/wide.jpg STYLE_FILES | $(DROSS)
 	$(RUN) docs.tex
 	$(GLOS) docs
 	$(RUN) docs.tex
 	$(CP) $(DROSS)/docs.pdf docs.pdf
-resources.pdf: $(ALL_FILES)
+resources.pdf: HANDOUTS STYLE_FILES | $(DROSS)
 	$(RUN) resources.tex
 	$(RUN) resources.tex
 	$(CP) $(DROSS)/resources.pdf resources.pdf
-booklet.pdf: $(wildcard fold*.tex) $(ALL_FILES) docs.pdf
+booklet.pdf: STYLE_FILES HANDOUTS docs.pdf | $(DROSS)
 	$(RUN) booklet.tex
 	$(RUN) booklet.tex
 	@pdfjam --angle 90 $(DROSS)/booklet.pdf --no-landscape --outfile $@
diff --git a/vars b/vars
index f8c78f5ce878302bda296f09416511d5af857b41..9acfa503bc01dba5802af50d2a02044c838da65c 100644
--- a/vars
+++ b/vars
@@ -15,11 +15,23 @@ RELEASE = $(TITLE).pdf
 GLOS := makeglossaries -d $(DROSS)
 RUN := lualatex -output-directory $(DROSS) -shell-escape
 CLEAN := $(RM) -r $(DROSS) $(LOCAL_DROSS) qr.tex *.pdf .switch-gls svg-inkscape
-DEPS := $(wildcard *.tex) $(wildcard config/*sty) config/ $(wildcard $(DROSS)/*.glg)
+
 
 $(RELEASE): $(DBOOK)
 	@$(CP) $< $@
 
+.PHONY: LOCTEX
+LOCTEX: $(wildcard *.tex)
+
+.PHONY: HANDOUTS
+HANDOUTS: config/CS.tex config/booklet.tex config/fold_front.tex config/fold_back.tex
+
+.PHONY: STYLE_FILES
+STYLE_FILES: config/$(wildcard *.sty)
+
+.PHONY: EXTERNAL
+EXTERNAL: $(wildcard $(DROSS)/*.glg) | $(DROSS)
+
 qr.tex: README.md config/vars
 	@printf '\qrcode[height=.2\\textwidth]{$(QR_TARGET)}' > qr.tex
 .switch-gls: