LATEX = pdflatex -interaction=nonstopmode
BIBTEX = bibtex

BASE = thesis
DOCUMENT = ${BASE}.pdf
AUX = ${BASE}.aux ${BASE}.bbl ${BASE}.blg ${BASE}.log ${BASE}.out ${BASE}.toc

.PHONY : all rebuild-refs clean

all : ${DOCUMENT}

clean : 
	@rm -frv ${DOCUMENT} ${AUX}

${DOCUMENT} :
	${LATEX} ${BASE}
	${LATEX} ${BASE}

rebuild-refs : 
	${LATEX} ${BASE}
	${BIBTEX} ${BASE}
	${LATEX} ${BASE}
	${LATEX} ${BASE}
