NAME = main

all : $(NAME).pdf 

$(NAME).pdf : *.bib $(shell find *.tex -not -name "slides.tex" -and -not -name "poster*.tex") figs/*
	pdflatex $(NAME).tex
	bibtex   $(NAME)
	-pdflatex $(NAME).tex
	-pdflatex $(NAME).tex

poster : *.bib poster*.tex
	pdflatex poster.tex
	bibtex poster
	pdflatex poster.tex
	pdflatex poster.tex

show : $(NAME).pdf
	evince $(NAME).pdf

clean: 
	-rm -rf $(NAME).pdf $(NAME).aux $(NAME).log $(NAME).bbl $(NAME).blg

spell :
	find . -name "*.tex" -exec aspell -c {} \;
