diff --git a/.latexmkrc b/.latexmkrc
new file mode 100644
index 0000000000000000000000000000000000000000..4f73a1bb78de79c5216252315632d393c69f00e8
--- /dev/null
+++ b/.latexmkrc
@@ -0,0 +1,10 @@
+   add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' );
+   add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
+   $clean_ext .= " acr acn alg glo gls glg";
+
+   sub makeglossaries {
+        my ($base_name, $path) = fileparse( $_[0] );
+        my @args = ( "-q", "-d", $path, $base_name );
+        if ($silent) { unshift @args, "-q"; }
+        return system "makeglossaries", "-d", $path, $base_name; 
+    }
diff --git a/Makefile b/Makefile
index bcda99db94eece7d60f2451d0b2252bbe2a797b9..af6d56539a0d78cf8ea40240f008e8530159f3e8 100644
--- a/Makefile
+++ b/Makefile
@@ -2,30 +2,34 @@ include vars
 
 output: docs.pdf
 
-rubbish/:
-	mkdir rubbish
+$(DROSS):
+	mkdir $(DROSS)
 
 images:
 	mkdir 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) | rubbish/
+ALL_FILES = $(wildcard *.tex) $(wildcard *.sty) | $(DROSS)
 
-rubbish/test.pdf: test.tex $(ALL_FILES)
+$(DROSS)/test.pdf: test.tex $(ALL_FILES)
+	$(RUN) test.tex
+	$(DROS) test
 	$(RUN) test.tex
 
 docs.pdf: images/wide.jpg $(ALL_FILES)
 	$(RUN) docs.tex
-	$(CP) rubbish/docs.pdf docs.pdf
+	$(GLOS) docs
+	$(RUN) docs.tex
+	$(CP) $(DROSS)/docs.pdf docs.pdf
 resources.pdf: $(ALL_FILES)
 	$(RUN) resources.tex
-	$(CP) rubbish/resources.pdf resources.pdf
+	$(CP) $(DROSS)/resources.pdf resources.pdf
 rules.pdf: images/wide.jpg $(ALL_FILES)
 	$(RUN) rules.tex
-	$(CP) rubbish/rules.pdf rules.pdf
+	$(CP) $(DROSS)/rules.pdf rules.pdf
 
 .PHONY: all clean
-all: docs.pdf resources.pdf rules.pdf rubbish/test.pdf 
+all: docs.pdf resources.pdf rules.pdf $(DROSS)/test.pdf 
 clean:
 	$(CLEAN) images/wide.jpg
diff --git a/vars b/vars
index 61051d508fa30629be76e2a8cc5bd2de73106524..19968fefe08bb51dd8bf89904b079df68a368ecb 100644
--- a/vars
+++ b/vars
@@ -1,6 +1,8 @@
 CP = ln -f
 BOOK = $(shell basename "$$(pwd)")
-COMPILER = latexmk -auxdir=rubbish -pdflua -silent -shell-escape -jobname=$(BOOK)
-RUN = lualatex -output-directory rubbish -shell-escape
+DROSS = $(shell head -1 .gitignore)
+COMPILER = latexmk -auxdir=$(DROSS) -pdflua -silent -shell-escape -r config/.latexmkrc -jobname=$(BOOK)
+GLOS = makeglossaries -d $(DROSS)
+RUN = lualatex -output-directory $(DROSS) -shell-escape
 QR_TARGET = $(shell grep 'mailto' README.md | cut -d' ' -f2)
-CLEAN = $(RM) -r rubbish qr.tex *.pdf
+CLEAN = $(RM) -r $(DROSS) qr.tex *.pdf