diff --git a/.gitignore b/.gitignore
index dd9d1582cc57319489fe0d79fdd9f2d95708ee49..ae49cb039f85d70fabc79149de2c9c532eff90e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,5 @@ old
 *.slo
 *.sls
 .switch-*
+*.fls
+*latexmk
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a56a284896d50cd3365231b3c9c14aa2ce8df070..d96d4d148a976b9592785debd88a51c161fd8a93 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,5 +11,4 @@ compile_pdf:
     - run
   artifacts:
     paths:
-      - BIND.pdf
-      - resources.pdf
+      - core.pdf
diff --git a/Makefile b/Makefile
index 819de3a7bc70793644b1a79b50e982aa8d9ad534..9b4c0ea5f3589cf920352b004e026390c4945d07 100644
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,26 @@
-output: main.pdf
-book: main.pdf
-	mv main.pdf BIND.pdf
+BOOK = $(shell basename "$$(pwd)")
+
+output: $(BOOK).pdf
 
 global: config/bind.sty .switch-gls
 .switch-gls:
-	touch -r Makefile .switch-gls
+	@touch -r Makefile .switch-gls
 config/bind.sty:
-	git submodule update --init
-
-main.pdf: main.gls config $(wildcard *tex)
-	pdflatex main.tex
-main.gls: svg-inkscape/logo_svg-tex.pdf
-	makeglossaries main
-	pdflatex main.tex
-svg-inkscape/logo_svg-tex.pdf: images/ global
-	pdflatex -shell-escape main.tex
-	pdflatex main.tex
-	pdflatex main.tex
+	@git submodule update --init
 
-svg-inkscape: global
-	pdflatex -shell-escape -jobname main.tex
-	pdflatex -jobname main.tex
+svg-inkscape: | config/bind.sty
+	@pdflatex -shell-escape -jobname $(BOOK) main.tex
+$(BOOK).glo: | svg-inkscape
+	@pdflatex -jobname $(BOOK) main.tex
+$(BOOK).sls: | $(BOOK).glo
+	@makeglossaries $(BOOK)
+$(BOOK).pdf: $(BOOK).sls
+	@pdflatex -jobname $(BOOK) main.tex
 
-resources: resources.pdf
-resources.pdf: main.gls global
-	pdflatex resources.tex
-
-all: resources book 
+all: $(BOOK).pdf 
+	latexmk -jobname=$(BOOK) -shell-escape -pdf main.tex
 
 clean:
 	rm -fr *.aux *.sls *.slo *.slg *.toc *.acn *.log *.ptc *.out *.idx *.ist *.glo *.glg *.gls *.acr *.alg *.ilg *.ind *.pdf sq/*aux svg-inkscape
+
+.PHONY: clean all