TEXFILES = \
	01_first.tex \
	03_styles.tex \
	04_plots.tex \
	texfigpresnt.tex 

JPG = \
	chap1fig3c.jpg\
	fig3d.jpg\
	figpstr1.jpg\
	psmat1.jpg\
	psmat2.jpg

DAT = plot.dat


EPS = ${JPG:%.jpg=%.eps}

STYLE = workshop.sty

PDFS = ${TEXFILES:%.tex=%.pdf}

all:  ${PDFS}

%.pdf:  %.tex $(STYLE) $(EPS)
	latex $<
	- bibtex $*
	while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log || \
	grep -q '^Package pdfscreen Warning: TOC file not available' $*.log ||\
	grep -q '^Package natbib Warning: Citation(s) may have changed' $*.log)\
	do latex $*; done
	dvips -T6in,4.5in -o $*.ps $*
	ps2pdf $*.ps

texfigpresnt.pdf:  texfigpresnt.tex
	pdflatex $<
	pdflatex $<

pstaddsnew.pdf:  pstaddsnew.tex
	latex $<
	- bibtex pstaddsnew
	while ( grep -q '^LaTeX Warning: Label(s) may have changed' pstaddsnew.log || \
	grep -q '^Package pdfscreen Warning: TOC file not available' pstaddsnew.log ||\
	grep -q '^Package natbib Warning: Citation(s) may have changed' pstaddsnew.log)\
	do latex pstaddsnew; done
	dvips -T12.80cm,9.60cm -o pstaddsnew.ps pstaddsnew
	ps2pdf pstaddsnew.ps


%.eps: %.jpg
	jpeg2ps $< > $@


archive:  workshop.zip

workshop.zip: ${TEXFILES} ${PDFS} ${STYLE} ${JPG} ${EPS} $(DAT) LICENSE \
	README Makefile clean
	zip $@ $+ 

clean:
	$(RM) *.aux *.bbl *.dvi *.log *.out *.toc *.blg *.lof *.lot *.zip *.ps *.nav *.snm *.vrb 

distclean: clean
	rm -f ${PDFS} ${EPS}
