DOCNAME = thesis

INPUT = $(DOCNAME).tex
TARGET= $(DOCNAME).pdf

THESIS_STY= mythesis.sty mythesismath.sty
EXTRASTYS = abhepexpt.sty abhep.sty abmath.sty lineno.sty siunitx.sty SIunits.sty varwidth.sty

default: $(TARGET)

$(TARGET): $(INPUT) extrastyles.zip $(THESIS_STY) Makefile chapters/*.tex
	@rm -f $(EXTRASTYS)
	@unzip extrastyles.zip
	@rm -f $(DOCNAME).{aux,toc,lof,lot}
	pdflatex $< && bibtex $(DOCNAME) && pdflatex $< && pdflatex $<
	@rm -f $(DOCNAME).{aux,toc,lof,lot}
	@rm -f $(EXTRASTYS)

clean:
	@rm -f $(EXTRASTYS)
	@rm -f *.{aux,toc,lof,lot}
	@rm -f *.{aux,bbl,blg,log,nav,out,snm,toc,lot,lof} $(TARGET)
	@rm -f comment.cut
