better compilation, leave directory clean
authorMart Lubbers <mart@martlubbers.net>
Mon, 22 May 2017 07:41:49 +0000 (09:41 +0200)
committerMart Lubbers <mart@martlubbers.net>
Mon, 22 May 2017 07:41:49 +0000 (09:41 +0200)
.gitignore
Makefile
output/.gitkeep [new file with mode: 0644]
thesis.tex

index bd7a20d..cd32fd5 100644 (file)
@@ -1,21 +1,2 @@
-*.acn
-*.acr
-*.alg
-*.aux
-*.bbl
-*.blg
-*.fmt
-*.glg
-*.glo
-*.gls
-*.ist
-*.lof
-*.log
-*.lol
-*.lot
-*.out
-*.pdf
-*.tdo
-*.toc
-*.xdy
+output/*
 img/fig-*
index 6c581a2..c13b415 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,11 @@ BIBTEX?=bibtex
 BIBTEXFLAGS:=
 MAKEGLOSSARIES?=makeglossaries
 MAKEGLOSSARIESFLAGS?=
-LATEXFLAGS:=-file-line-error -halt-on-error -no-shell-escape
+LATEXFLAGS:=\
+       -file-line-error\
+       -halt-on-error\
+       -no-shell-escape\
+       -output-directory=./output/
 
 FIGURES:=$(addsuffix .png,$(addprefix img/,$(notdir $(basename $(wildcard fig/*.dot)))))
 LISTINGS:=$(wildcard listings/*)
@@ -17,13 +21,13 @@ BIBS:=$(wildcard *.tex)
 
 all: $(addsuffix .pdf,$(DOCS))
 
-%.fmt: %.pre
-       $(LATEX) $(LATEXFLAGS) -ini -jobname="$(basename $@)" "&$(LATEX) $<\dump"
+output/%.fmt: %.pre
+       $(LATEX) $(LATEXFLAGS) -ini -jobname="$(basename $<)" "&$(LATEX) $<\dump"
 
 %.pdf: %.mlog
        if $(GREP) -iFq 'Rerun' $<; then $(LATEX) $(LATEXFLAGS) $(basename $<); fi
 
-%.mlog: %.tex %.fmt $(BIBS) $(TEXS) $(FIGURES) $(LISTINGS)
+%.mlog: %.tex output/%.fmt $(BIBS) $(TEXS) $(FIGURES) $(LISTINGS)
        $(LATEX) $(LATEXFLAGS) $<
        if $(GREP) -q '^\\bibdata{' $(basename $<).aux; then $(BIBTEX) $(BIBTEXFLAGS) $(basename $<); fi
        if $(GREP) -q '\@istfilename' $(basename $<).aux; then $(MAKEGLOSSARIES) $(MAKEGLOSSARIESFLAGSFLAGS) $(basename $<); fi
@@ -33,6 +37,4 @@ img/%.png: fig/%.dot
        dot -Tpng $< > $@
 
 clean:
-       $(RM) $(foreach DOC,$(DOCS),$(addprefix $(DOC).,\
-               acn acr alg aux bbl blg fmt glg glo gls ist lof log lol lot nav out\
-               pdf run.xml snm tdo toc vrb xdy)) $(FIGURES)
+       $(RM) output/** $(FIGURES)
diff --git a/output/.gitkeep b/output/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
index a1c50d3..218e2ee 100644 (file)
@@ -1,4 +1,4 @@
-%&thesis
+%&output/thesis
 \usepackage[nonumberlist,acronyms]{glossaries}
 \makeglossaries%