########################################################################
#                 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

#FCFlags := ${FCFlags} -Nx10000 -Ns2000 -Nn10000 -Nc100 -Nq2000

FCFlags		:=	${FCFlags}
crayFCFlags	:=	${crayFCFlags} -Wf"-dp" -Wf"-astack"
sun4FCFlags	:=	${sun4FCFlags} -O

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

F77Srcs	:=	gcmdln.f  help.F  scalu.F parchk.f array.f fndnri.f \
            gain.f intrms.f kapris.f pray.f qloss.f rmsint.f \
            sphere.f tdfninb.f charct.f polfit.f

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

PRGM :=	${LocalBin}/scalu

targets : ${PRGM}

all :  safe clean targets remotes install

${PRGM}    :  ${F77Objs}
	${LinkF} -o $@ ${F77Objs} ${Libes}
#	${shell /usr/demo/SOUND/play /usr/demo/SOUND/sounds/flush.au}

remotes:	RemoteCopies RemoteMakes

install:
	mancopy 1 scalu
	execopy  scalu
	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: ${AllSrcs}
	usp_d_stamp
	${FindIncludes}

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