########################################################################
#                 copyright 2001, Amoco Production Company             #
#                             All Rights Reserved                      #
#                     an affiliate of BP America Inc.                  #
########################################################################

# gmake makefile for usp program.
# 09/27/89	Terri Fischer

include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.mathadv

Libes		:= -lut -lieeeio -lfu ${MathAdvO}
#
# Add an architecture library variable which may be set in one of the gmake
# rules files referenced above. Initialized with SOLARIS port.. - jmw 8/9/93
#
Libes	:=	${Libes} ${${TArchDir}Libes}


sun3CCFlags	:=	${sun3CCFlags} -DSUN -O
sun3fpaCCFlags	:=	${sun3fpaCCFlags} -DSUN -ffpa -O
sun4CCFlags	:=	${sun4CCFlags} -DSUN -O
crayCCFlags	:=	${crayCCFlags} -DCRAY


sun3FCFlags	:=	${sun3FCFlags} -DSUN -O2
sun3fpaFCFlags	:=	${sun3fpaFCFlags} -DSUN -ffpa -O
sun4FCFlags	:=	${sun4FCFlags} -DSUN -O
crayFCFlags	:=	${crayFCFlags} -DCRAY -Wf"-astack" -Wf"-es" -Wf"-dp"

F77Srcs		:= wavest.F wavproc.F \
                   dgraph.F drum.F enorm.F ftrd.F ftrd1.F idft.F maxdat.F \
                   prnorm.F rstr.F rstr1.F spln1.F spln2.F stwi.F \
                   tpfsp.F unband.F zero.F smainch.F spcmtx.F sprew32.F \
                   sserb.F ssnrdet.F sscph.F cross_spectrum_thom.F dmoments.F \
                   thomloop_cross.F thomwgta.F tridpssd.F trieigd.F stppf2.F \
                   ssngrph.F ssmph.F seleigd.F padp2.F eigval.F eigencoeff.F \
                   dscrag.F dpswfa.F djtmeana.F dforrt.F dfastg.F stdpold.F \
                   specon_cross.F comtrand2.F

SafeFiles	:= ${AllSrcs} ${wildcard *.1} Makefile  wavest.pattern

PRGM		:= ${LocalBin}/wavest

targets : ${PRGM}

all :  safe clean targets install remotes

${PRGM}    :  ${F77Objs}
	${LinkF} -o $@ ${F77Objs} ${Libes}

install:
	mancopy 1 wavest
	execopy  wavest
	shadowexec -v execopy wavest

remotes:	RemoteCopies RemoteMakes

RemoteCopies:	${SafeFiles}
	shadowcopy -v $? && touch RemoteCopies

RemoteMakes:	${SafeFiles}
	shadowexec -v ${MAKE} && touch RemoteMakes

safe:	.safe.${jdate}.Z

.safe.${jdate}.Z:	${SafeFiles}
	${MakeSafe}

include ${TArchDir}/included.files

${TArchDir}/included.files: ${AllSrcs}
	usp_d_stamp
	${FindIncludes}

clean:
	-rm ${TArchDir}/included.files ${AllObjs} ${PRGM} \
		date.h RemoteCopies RemoteMakes ${wildcard ShdCpy*}
