# to use xelatex or lualatex instead of pdflatex, replace -pdf by -xelatex or -lualatex
FLAGS = -pdf -interaction=nonstopmode -halt-on-error -bibtex

.PHONY: all clean

# build main.pdf
all:
	latexmk $(FLAGS) main.tex

# build and, if build main.pdf successful, remove intermediate files
clean: all
	latexmk -c main.tex
	rm -f main.bbl main.thm
