# $Id: Makefile,v 1.10 2006-01-16 19:14:29 eugene Exp $

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

help:
	@echo "USAGE: make (target)"
	@echo "  targets: sdrs all sdrs-tag"

all : sdrs
sdrs : ModulesSDRS.pdf

SDRS = ModulesSDRS.tex \
       ChangeLogSDRS.tex \
       CameraImages.tex \
       pics/CameraLayout.ps \
       ../pslib/pics/coordinateFrames.ps \
       ../pslib/pics/coordinateConv.ps

ModulesSDRS.pdf: $(SDRS)

sdrs-tag:
	cvs tag `grep "version{" ModulesSDRS.tex | tr "{}" " " | awk '{printf "MSDR-%02d\n", $$2}'` $(SDRS)

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

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

dist : clean
	$(RM) *.pdf

empty : clean

