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

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

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

F77Srcs         := ttmain.F ttinit.F txy2txy.F xyt2txy.F ttdparse.F  \
		   txy2xyt.F xyw2txy.F ttparm.F txy2xyw.F
CSrcs           :=      sigign.c

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

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

targets : ${PRGM}

all :  safe clean targets install remotes

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

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