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

# gmake makefile for usp program.

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

Libes		:= ${MathAdvO} -lut -lieeeio -lfu 
#
# 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} -Bdynamic
Libes	:=	${Libes} ${${TArchDir}Libes}

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


#sunFCFlags	:=	${sunFCFlags} -O5 -parallel
#sunFCFlags	:=	${sunFCFlags} -O5 -autopar -stackvar
#sunFCFlags	:=	${sunFCFlags} -DSUN 
sunFCFlags	:=	${sunFCFlags} -O5 

#sunFLFlags	:=	${sunFLFlags} -parallel
# sunFLFlags	:=	${sunFLFlags} -autopar

F77Srcs		:= 	main.F	\
			dcray.F	\
			downward.F	\
			dps.F	\
			func.F	\
			func1.F	\
			pcs.F	\
			pest.F	\
			pickanevent.F	\
			help.F	\
			cmdln.F	\
			ratint.F	\
			rc.F	\
			rtbis.F	\
			rtbis1.F	\
			timer.F	\
			wavelet.F	\
			zero.F	\
			four1.F	\
			wave2.F	\
			wavelet_trans.F	\
			strech.F	\
			copy.F	\
			hilbert.F

SafeFiles	:= ${AllSrcs} Makefile

PRGM		:= ${LocalBin}/dcray

targets : 	${PRGM}

all :  safe targets install remotes

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

install:
	mancopy 1 dcray
	execopy  dcray
	shadowexec -v ${MAKE} install

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}
	${DEPTROOT}/usp/bin/usp_d_stamp
	${FindIncludes}

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