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

#gmake file for usp fk
############

#include ${DEPTROOT}/etc/gmake.init.db
#include ${DEPTROOT}/etc/gmake.usp
include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.mathadv
include ${DEPTROOT}/etc/gmake.mbs 
#
# this doesn't seem to really be using dds
#
# include ${DEPTROOT}/etc/gmake.dds

Libes		:= ${MathAdvO} -lut -lieeeio -lfu
# -ldds_r2 -lNoDisco -lrlsf_r1 -lm
Libes   :=      ${Libes} ${${Vendor}Libes} ${${TArchDir}Libes}

sun4CCFlags	:=	${sun4CCFlags} -D _NO_PROTO
cray2CCFlags	:=	${cray2CCFlags} -D_NO_PROTO
crayxeaCCFlags  :=	${crayxeaCCFlags} -D_NO_PROTO
crayc90CCFlags  :=	${crayc90CCFlags} -D_NO_PROTO
crayympCCFlags  :=	${crayympCCFlags} -D_NO_PROTO
crayj90CCFlags  :=	${crayj90CCFlags} -DCRAY -DCRAYJ90 -D _NO_PROTO
hpCCFlags       :=      ${hpCCFlags} -D_hpux -Wp,-H500000
sgiCCFlags      :=      ${sgiCCFlags} -O3

sun4FCFlags	:=	${sun4FCFlags} -DSUN -O -nodoc
cray2FCFlags	:=	${cray2FCFlags} -DCRAY -DCRAY2 -Wf"-astack" -Wf"-es" -Wf"-dp"
crayxeaFCFlags	:=	${crayxeaFCFlags} -DCRAY -DCRAYXEA -Wf"-eus" -Wf"-dp"
crayc90FCFlags	:=	${crayc90FCFlags} -DCRAY -DCRAYC90 -Wf"-eus" -Wf"-dp"
crayympFCFlags	:=	${crayympFCFlags} -DCRAY -DCRAYYMP -Wf"-eus" -Wf"-dp"
crayj90FCFlags  :=      ${crayj90FCFlags} -DCRAY -DCRAYJ90 -Wf"-eus" -Wf"-dp"

hpFLFlags       :=      ${hpFLFlags} +U77 -D_hpux +e
rs6000CCFlags   :=      ${rs6000CCFlags} -D_IBMR2 -O
rs6000FCFlags   :=      ${rs6000FCFlags} -D_IBMR2 -O -nodoc -qxflag=hsflt
convexCCFlags   :=	${convexCCFlags} -D__convex__ -O2 -re
convexFCFlags   :=	${convexFCFlags} -D__convex__ -O2 -re
sgiFCFlags      :=      ${sgiFCFlags} -O3 -DIRIX -OPT:const_copy_limit=14667 \
			-OPT:fold_arith_limit=2711

sun4cg89FCFlags :=      ${sun4cg89FCFlags} -fast -O4 -cg89
sun4cg89FLFlags :=      ${sun4cg89FLFlags} -fast -O4

sun4cg92FCFlags :=      ${sun4cg92FCFlags} -fast -O4 -cg92
sun4cg92FLFlags :=      ${sun4cg92FLFlags} -fast -O4

c2mpLibes       :=      ${c2mpLibes} -lveclib

CSrcs		:= 
F77Srcs         := fk.F     \
xt2ap.F                         \
ap2xt.F                         \
hdupdat.F                       \
hdupdatf.F                       \
clrgather.F                     \
wrgather.F                      \
getf.F                          \
toeplitz.F                      \
getftf.F                        \
pack.F                          \
median5.F                       \
rdgather.F


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

PRGM		:= ${LocalBin}/fk

targets : ${PRGM}

all :  safe clean targets install remotes

${PRGM}    :  ${F77Objs} ${CObjs}
	${LinkF} -o $@ ${AllObjs} ${Libes} ${LibFtn${TArchDir}}

install:
	mancopy 1 fk
	execopy  fk
	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*}
