########################################################################
#                 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           := ${MathAdvO} -lut -lieeeio -ltattle -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}


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

sun3FCFlags	:=	${sun3FCFlags} -DSUN -O2
sun3fpaFCFlags	:=	${sun3fpaFCFlags} -DSUN -ffpa -O
sun4FCFlags	:=	${sun4FCFlags} -DSUN -O 
#sun4u-SC4FCFlags:=	${sun4u-SC4FCFlags} -pg
sun4cg92FCFlags	:=	${sun4cg92FCFlags} -fast ${sun4cg92FCFlags}
crayFCFlags	:=	${crayFCFlags} -DCRAY -Wf"-astack" -Wf"-es" -Wf"-dp"
crayxeaFCFlags  :=      -DCRAY -Wf"-astack" -Wf"-eus" -Wf"-dp"
convexFCFlags	:=      -re -O2

sunFLFlags	:=	${sunFLFlags} 
#sunFLFlags	:=	${sunFLFlags} -pg
hpFLFlags	:=	${hpFLFlags} +U77 +FPoD -N
sun4cg92FLFlags	:=	${sun4cg92FLFlags} -fast ${sun4cg92FLFlags}
#
F77Srcs         := median3d.F \
		process.F \
		write_avg_record.F \
		window_median.F \
		sort_for_median.F \
		isample_sums.F \
		live.F
		

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

PRGM	:= ${LocalBin}/median3d
#PRGM   	:= ./median3d

targets : ${PRGM}

all :  safe clean targets remotes install

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

install:
	mancopy 1 median3d
	execopy  median3d
	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}
	usp_d_stamp
	${FindIncludes}


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