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

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

Libes		:= ${Libes} -lut ${MathAdvO} -lieeeio -lfu
Libes		+= ${${TArchDir}Libes}

CCFlags		:=	${CCFlags}
FCFlags		:=	${FCFlags}
#sunFCFlags	:=	${sunFCFlags} -DSUN -g

F77Srcs		:= hthresh.F hthresh_sub.F

SafeFiles	:= ${AllSrcs} hthresh.pattern hthresh.1 Makefile

PRGM		:= ${LocalBin}/hthresh

targets : ${PRGM}

all :  safe targets remotes install

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

#  do remote make (i.e. in our case the cray, hp, convex, etc...)

remotes:	RemoteCopies RemoteMakes

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

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

#  generate include files
#  date stamp source

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

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