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

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

# define the targets

PRGM	:=	${LocalBin}/eign

# set the architecture dependent variables

crayCCFlags	:=	-DCRAY

crayFCFlags	:=	-DCRAY -es -dp
		
CommonLibes	+= 	${MathAdvO} -lfu -lut -lieeeio -lm

crayLibes	+= 	-lnet

Libes	:=	${CommonLibes} ${${Vendor}Libes} ${${TArchDir}Libes}

F77Srcs		:=	eign5b.F  datout5b.F  encode5b.F  olptrn5b.F  \
			rdparm5b.F  rtrain5b.F  egmedn.F  lodc2w5b.F  \
			plyck.F  region5b.F  egnran.F  lodw2z5b.F  \
			prmtrx5b.F  revval5b.F  normlz5b.F  rcovar5b.F  \
			robust5b.F

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

.PHONY:	all safe remotes targets 

targets:	${PRGM}

all:	safe targets remotes install

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

remotes:	RemoteCopies  RemoteMakes

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

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

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

include ${TArchDir}/included.files

${TArchDir}/included.files:	${AllSrcs}
	${CCIncl} ${AllSrcs} > included.files

safe:	.safe.${jdate}.Z

.safe.${jdate}.Z:	${SafeFiles}
	${MakeSafe}

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