# Makefile for pdf/ps slides

FILES=sa-presentation.tex $(shell ls */*.tex) $(shell ls */*.pdf */*.ocl */*.java */*.mp)
VIEWEROPTS=-fullscreen
PDFVIEWER=xpdf
LTXRUNS=2
SEQ=$(shell if which seq >/dev/null ; then echo seq; else echo gseq; fi)

all: beamer.pdf handout.pdf

%.pdf: %.tex $(FILES)
	make -C overview
	make -C implementation
	make -C modeling
	for i in `${SEQ} 1 ${LTXRUNS}` ; do TEXINPUTS=${TEXINPUTS} pdflatex $< ; done

view: beamer.pdf
	${PDFVIEWER} ${VIEWEROPTS} $<

macview: beamer.pdf
	open $<

present: beamer.pdf
	keyjnote -t Crossfade -T 200 beamer.pdf

clean: 
	rm -fv *~ *.aux *.log *.toc *.out *.snm *.nav beamer.{pdf,ps,dvi} handout.{pdf,ps,dvi} *.vrb slide.pdf
	make -C overview clean
	make -C implementation clean
	make -C modeling clean
