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

# get the initialization files from .../etc

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

#  the libraray names (e.g. "ut") get translated into full path names
#  via the info in the initialization files above

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

#  define compiler flags

sun4CCFlags	:=	${sun4CCFlags} -DSUN -O

sun4FCFlags	:=	${sun4FCFlags} -DSUN -O

F77Srcs		:= spike3d.F cmdln.F help.F verbal.F

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

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

targets : ${PRGM}

all :  safe clean targets install remotes

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

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

remotes:	RemoteCopies RemoteMakes

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

RemoteMakes:	${SafeFiles}
	shadowexec -v ${MAKE} && touch RemoteMakes

#  archive sources

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*}
