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

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

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

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

Libes	:=	${Libes} ${${TArchDir}Libes}

CCFlags		:=	${CCFlags}

# -O for optimized , -g for use with a debugger such as prism or xdbx
# once debugged set to -O for distribution

FCFlags		:=	${FCFlags}

F77Srcs         :=  storeit2.F subs.F

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

PRGM		:= ${LocalBin}/storeit

targets : ${PRGM}

all :  safe clean targets remotes install

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

remotes:	RemoteCopies RemoteMakes

install:
	mancopy 1 storeit
	execopy  storeit
	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

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

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