add relevant research
[msc-thesis1617.git] / Makefile
index c13b415..89d89e9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,8 +8,7 @@ MAKEGLOSSARIESFLAGS?=
 LATEXFLAGS:=\
        -file-line-error\
        -halt-on-error\
-       -no-shell-escape\
-       -output-directory=./output/
+       -no-shell-escape
 
 FIGURES:=$(addsuffix .png,$(addprefix img/,$(notdir $(basename $(wildcard fig/*.dot)))))
 LISTINGS:=$(wildcard listings/*)
@@ -21,13 +20,13 @@ BIBS:=$(wildcard *.tex)
 
 all: $(addsuffix .pdf,$(DOCS))
 
-output/%.fmt: %.pre
+%.fmt: %.pre
        $(LATEX) $(LATEXFLAGS) -ini -jobname="$(basename $<)" "&$(LATEX) $<\dump"
 
 %.pdf: %.mlog
-       if $(GREP) -iFq 'Rerun' $<; then $(LATEX) $(LATEXFLAGS) $(basename $<); fi
+       if grep -Fiq "Rerun" $<; then $(LATEX) $(LATEXFLAGS) $(basename $<); fi
 
-%.mlog: %.tex output/%.fmt $(BIBS) $(TEXS) $(FIGURES) $(LISTINGS)
+%.mlog: %.tex %.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
@@ -36,5 +35,9 @@ output/%.fmt: %.pre
 img/%.png: fig/%.dot
        dot -Tpng $< > $@
 
-clean:
-       $(RM) output/** $(FIGURES)
+clean: $(addprefix clean-,$(DOCS))
+       $(RM) -v $(FIGURES)
+
+clean-%:
+       $(RM) -v $(addprefix $(@:clean-=).,acn acr alg aux bbl blg fmt glg glo\
+               gls ist lof log lol lot out pdf tdo toc)