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

# gmake makefile for usp program.

include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.mathadv
# ifneq "${TArchBinDir}" "sun4u"
include ${DEPTROOT}/etc/gmake.linpack
# else
# Linpack         := -lsunperf
# endif
 
Libes           := ${Linpack} ${MathAdvO} -lut -lieeeio -lfu -lmxprt
#
# 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
#
#use next line for power fortran compiling
IRIX64Libes   := -lfastm -lmp
#

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


sun3CCFlags	:=	${sun3CCFlags} -DSUN -O
sun3fpaCCFlags	:=	${sun3fpaCCFlags} -DSUN -ffpa -O
sun4CCFlags	:=	${sun4CCFlags} -DSUN -O
crayCCFlags	:=	${crayCCFlags} -DCRAY
convexCCFlags	:=      -re -O2

sun3FCFlags	:=	${sun3FCFlags} -DSUN -O2
sun3fpaFCFlags	:=	${sun3fpaFCFlags} -DSUN -ffpa -O
sun4FCFlags	:=	${sun4FCFlags} -DSUN -O
sun4cg92FCFlags	:=	${sun4cg92FCFlags} -fast ${sun4cg92FCFlags}
crayFCFlags	:=	${crayFCFlags} -DCRAY -Wf"-astack" -Wf"-es" -Wf"-dp"
crayxeaFCFlags  :=      ${crayxeaFCFlags} -DCRAY -Wf"-astack" -Wf"-eus" -Wf"-dp"
convexFCFlags	:=      ${convexFCFlags} -re -O2
#sgiFCFlags	:=      ${sgiFCFlags} -O0 -static -pfa \
#			-OPT:const_copy_limit=11000 -OPT:fold_arith_limit=2000
#sgiFCFlags	:=      ${sgiFCFlags} -O1 -static \
#			-OPT:const_copy_limit=11000 -OPT:fold_arith_limit=2000
#sgiFCFlags	:=      -O3 \
#			-OPT:fold_arith_limit=1783 \
#			-OPT:const_copy_limit=10644 \
#			-OPT:IEEE_arithmetic=3:roundoff=3 \
#			-WK,-o=5,-ro=3,-so=3 -pfa
sgiFCFlags	:=      -OPT:fold_arith_limit=1783 \
			-OPT:const_copy_limit=10644 \
			-OPT:IEEE_arithmetic=3:roundoff=3

IRIX64FCFlags	:=      -O3 \
			-WK,-o=5,-ro=3,-so=3

sunFLFlags	:=	${sunFLFlags} 
#sgiFLFlags	:=	${sgiFLFlags}
sgiFLFlags	:=	${sgiFLFlags} -mp
hpFLFlags	:=	${hpFLFlags} +U77 +FPoD -N
sun4cg92FLFlags	:=	${sun4cg92FLFlags} -fast ${sun4cg92FLFlags}
#
#
F77Srcs         := radon3d.F \
cmdlin.F                        \
aztapr.F                        \
fwdlsq.F                \
revlsq.F                \
rmmfft.F                        \
wrgather.F                      \
rdgather.F                      \
wrtaup.F                        \
rdtaup.F                        \
fwddrt.F                        \
revdrt.F                        \
filtdrt.F                       \
getmute.F                       \
getwxy.F                        \
getgrid.F                       \
getcomp.F                       \
invert.F                        \
clev.F                          \
deadrec.F
#
#
#

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

PRGM		:= ${LocalBin}/radon3d

targets : ${PRGM}

all :  safe clean targets remotes install

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

ifeq "${Vendor}" "sgi"
${TArchDir}/taupsembur.o:: taupsembur.F
	${MakeTArchDir}
	${CompileF} -O3 -col72 -o $@ $<
	${RemakeRemotes}

${TArchDir}/process.o:: process.F
	${MakeTArchDir}
	${CompileF} -O3 -col72 -o $@ $<
	${RemakeRemotes}
endif
	
install:
	mancopy 1 radon3d
	execopy  radon3d
	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*}
