BUILDDIR = build SRCDIR = src RESDIR = res TEMPDIR = tmp CC = latexmk CFLAGS = -pdf -shell-escape -halt-on-error TARGETS = $(BUILDDIR)/thesis.pdf all: precomp $(TARGETS) postcomp precomp: @mkdir -p $(TEMPDIR) @cd $(TEMPDIR) && ln -s ../$(SRCDIR)/* . @cd $(TEMPDIR) && ln -s ../$(RESDIR)/* . postcomp: @rm -r $(TEMPDIR) $(BUILDDIR)/thesis.pdf: $(TEMPDIR)/thesis.tex $(CC) $(CFLAGS) -output-directory=../$(BUILDDIR) -cd $< f: clean all clean: rm -r $(BUILDDIR) show: okular $(TARGETS) & .PHONY: all precomp postcomp show clean f