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

# Template gmake makefile for usp programs.
# 07/18/89	Terri Fischer

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

sun4CCFlags	:=	${sun4CCFlags} -DSUN -O
crayCCFlags	:=	${crayCCFlags} -DCRAY

sun4FCFlags	:=	${sun4FCFlags} -DSUN -O
crayFCFlags	:=	${crayFCFlags} -DCRAY -Wf"-astack" -Wf"-es" -Wf"-dp"


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

F77Srcs	:=	prepr3d.F 

SafeFiles :=	${F77Srcs} ${wildcard *.1} Makefile  prepr3d.pattern

PRGM     := ${LocalBin}/prepr3d
#PRGM     :=	prepr3d

targets : ${PRGM}

all :  safe clean targets remotes install 

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

remotes:	RemoteCopies RemoteMakes

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

RemoteCopies:	${SafeFiles}
	shadowcopy -v $?
	touch RemoteCopies

RemoteMakes:	${SafeFiles}
	shadowexec ${MAKE}
	touch RemoteMakes

safe:	.safe.${jdate}.Z

.safe.${jdate}.Z:	${SafeFiles}
	${MakeSafe}

include ${TArchDir}/included.files

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

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