# $Id: Makefile,v 1.18 2006-08-04 12:55:02 eugene Exp $

PDFLATEX = env TEXINPUTS=../../latex/inputs:$(TEXINPUTS):.: pdflatex
PSLATEX  = env TEXINPUTS=../../latex/inputs:$(TEXINPUTS):.: latex

help:
	@echo "USAGE: make (target)"
	@echo "  targets: srs ssdd scd all cdrresp pars comm"

scd: ippSCD.pdf
srs: ippSRS.pdf
ssdd: ippSSDD.pdf
cdrresp: ippCDRresponse.pdf
pars: ippParameters.pdf
comm: ippCommission.pdf

scd-draft: ippSCDdraft.pdf

all : srs ssdd scd

ippSRS.pdf : ippSRS.tex
	./trace.pl ippSRS.tex ippSRSout.tex ippSRStrace.tex
	make ippSRSout.pdf
	mv ippSRSout.pdf ippSRS.pdf
	rm -f ippSRSout.tex ippSRStrace.tex

%.pdf: %.tex
	$(PSLATEX) $*.tex || exit
	$(PSLATEX) $*.tex || exit
	dvips -z -t letter -o $*.ps $*.dvi || exit
	ps2pdf $*.ps $*.pdf || exit
	thumbpdf --modes=dvips $*.pdf || exit
	$(PSLATEX) $*.tex  || exit
	dvips -z -t letter -o $*.ps $*.dvi || exit
	ps2pdf $*.ps $*.pdf || exit
	@rm -f $*.ps $*.dvi $*.aux $*.log $*.tbr $*.tbd $*.lof $*.toc $*.tpm body.tmp head.tmp

clean :
	$(RM) *.log *.dvi *.aux *.toc *.tbd *.tbr *.lof *.out *.tpm *~ core body.tmp head.tmp

dist : clean
	$(RM) *.pdf

empty : clean
