From 1f80c2e13d24d5617c8256ff64dfa485097f868c Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Mon, 22 May 2017 09:41:49 +0200 Subject: [PATCH] better compilation, leave directory clean --- .gitignore | 21 +-------------------- Makefile | 16 +++++++++------- output/.gitkeep | 0 thesis.tex | 2 +- 4 files changed, 11 insertions(+), 28 deletions(-) create mode 100644 output/.gitkeep diff --git a/.gitignore b/.gitignore index bd7a20d..cd32fd5 100644 --- a/.gitignore +++ b/.gitignore @@ -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-* diff --git a/Makefile b/Makefile index 6c581a2..c13b415 100644 --- 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 index 0000000..e69de29 diff --git a/thesis.tex b/thesis.tex index a1c50d3..218e2ee 100644 --- a/thesis.tex +++ b/thesis.tex @@ -1,4 +1,4 @@ -%&thesis +%&output/thesis \usepackage[nonumberlist,acronyms]{glossaries} \makeglossaries% -- 2.20.1