MAIN = main
LATEX = xelatex
BIBER = biber

all: $(MAIN).pdf

$(MAIN).pdf: $(MAIN).tex chapters/*.tex refs.bib
	$(LATEX) $(MAIN).tex
	$(BIBER) $(MAIN)
	$(LATEX) $(MAIN).tex
	$(LATEX) $(MAIN).tex

clean:
	rm -f *.aux *.log *.out *.toc *.bbl *.blg *.synctex.gz *.fdb_latexmk *.fls *.run.xml *.bcf

distclean: clean
	rm -f $(MAIN).pdf

.PHONY: all clean distclean
