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

F77Srcs		:= fxydecon.F subs.F

CSrcs		:= dwrite.c

# F90Srcs         := fsubs.f90 ft3d.F90 windowsubs.f90 gsubs.f90 fxysub.F90
F90Srcs         := fsubs.f90 ft3d.f90 windowsubs.f90 gsubs.f90 fxysub.f90

SafeFiles	:= ${AllSrcs} Makefile fxydecon.1 fxydecon.pattern


sunF90Flags	+=      -lF77 
sunLibes	+=	-lF77

sunLibes           +=	-lF77
sgiLibes           +=	-lcomplib.sgimath_mp

# name of your routine
FXYDECON		:= ${LocalBin}/fxydecon

targets : ${FXYDECON}

all :  safe targets remotes install

${FXYDECON}    :  ${F77Objs} ${F90Objs} ${CObjs}
	${LinkF90} -o $@ ${F77Objs} ${F90Objs} ${CObjs}  ${Libes}

#fsubs.f90: fsubs.r
#	ratfor -6x fsubs.r > fsubs.f90
# Ray used this stuff during the development of this code, if you
# know how to use it feel free to fire it up again, it is not required
# to compile this routine.

#  do remote make (i.e. in our case the cray, hp, convex, etc...)

remotes:	RemoteCopies RemoteMakes

install:
	mancopy 1 fxydecon
	execopy  fxydecon
	shadowexec -v execopy fxydecon

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

#  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
