# vim:ft=make
-include config.mk

.PHONY: all clean dist-clean

### Variables
MAIN_SRC  ?= main.tex
TEXENGINE ?= latexmk --pdf

MAIN_TARGET = $(patsubst %.tex,%.pdf,$(MAIN_SRC))

### Targets
all: $(MAIN_TARGET)

dist: all clean

$(MAIN_TARGET): $(MAIN_SRC)
	$(TEXENGINE) $^

dist-clean: clean
	@rm -vf *.pdf *.eps *.dvi *.ps

clean:
	@rm -vf *.dat *.log *.out *.aux *.nav *.snm *.toc *.vrb *~ *.fls *.fdb_latexmk *-blx.bib *.bbl *.blg *.run.xml