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

#
#	gmake Makefile for liblinpack.a
#

include ${DEPTROOT}/etc/gmake.init
#
#	fortran compiler flags: for now, wrap cray2 flags in -CRAY ... -ALL
#
sunFCFlags	:=	-O
crayFCFlags	:=	-a stack -nodoc -DCRAY
RS6000FCFlags   :=      -D_IBMR2 -O -nodoc -qxflag=hsflt -qcharlen=8192
hpFCFlags       :=      -u -O -nodoc
c34FCFlags	:=	-O2 -re -nodoc

ifeq "${Vendor}" "sun"
ifeq "${CompLevel}" "4"
  sunFCFlags := ${sunFCFlags} -dalign -O3 -xlibmopt -depend
endif
endif
#
#	C compiler flags: same on all machines
#
CFLAGS		:=	-O
c34CFLAGS	:=	-O2 -re
#
#	This is the guy we're trying to make.  Note that the
#	target is a function of the target architecture.
#
LIB		:=	${LocalLib}/liblinpack.a
#
#	These are the F77 source files that go into ${LIB}
#
F77Srcs		:=	cchdc.f cchdd.f cchex.f cchud.f cgbco.f cgbdi.f \
			cgbfa.f cgbsl.f cgeco.f cgedi.f cgefa.f cgesl.f \
			cgtsl.f chico.f chidi.f chifa.f chisl.f chpco.f \
			chpdi.f chpfa.f chpsl.f cpbco.f cpbfa.f cpbsl.f \
			cpoco.f cpodi.f cpofa.f cposl.f cppco.f cppdi.f \
			cppfa.f cppsl.f cptsl.f cqrdc.f cqrsl.f crotg.f \
			cscal.f csico.f csidi.f csifa.f csisl.f cspco.f \
			cspdi.f cspfa.f cspsl.f csrot.f csscal.f csvdc.f \
			cswap.f ctrco.f ctrdi.f ctrsl.f dasum.f daxpy.f \
			dcabs1.f dchdc.f dchdd.f dchex.f dchud.f dcopy.f \
			ddot.f dgbco.f dgbdi.f dgbfa.f dgbsl.f dgeco.f \
			dgedi.f dgefa.f dgesl.f dgtsl.f dnrm2.f dpbco.f \
			dpbdi.f dpbfa.f dpbsl.f dpoco.f dpodi.f dpofa.f \
			dposl.f dppco.f dppdi.f dppfa.f dppsl.f dptsl.f \
			dqrdc.f dqrsl.f drot.f drotg.f dscal.f dsico.f \
			dsidi.f dsifa.f dsisl.f dspco.f dspdi.f dspfa.f \
			dspsl.f dsvdc.f dswap.f dtrco.f dtrdi.f dtrsl.f \
			dzasum.f dznrm2.f icamax.f idamax.f isamax.f \
			izamax.f sasum.f saxpy.f scasum.f schdc.f schdd.f \
			schex.f schud.f scnrm2.f scopy.f sdot.f sgbco.f \
			sgbdi.f sgbfa.f sgbsl.f sgeco.f sgedi.f sgefa.f \
			sgesl.f sgtsl.f snrm2.f spbco.f spbdi.f spbfa.f \
			spbsl.f spoco.f spodi.f spofa.f sposl.f sppco.f \
			sppdi.f sppfa.f sppsl.f sptsl.f sqrdc.f sqrsl.f \
			srot.f srotg.f sscal.f ssico.f ssidi.f ssifa.f \
			ssisl.f sspco.f sspdi.f sspfa.f sspsl.f ssvdc.f \
			sswap.f strco.f strdi.f strsl.f zaxpy.f zchdc.f \
			zchdd.f zchex.f zchud.f zcopy.f zdotc.f zdotu.f \
			zdrot.f zdscal.f zgbco.f zgbdi.f zgbfa.f zgbsl.f \
			zgeco.f zgedi.f zgefa.f zgesl.f zgtsl.f zhico.f \
			zhidi.f zhifa.f zhisl.f zhpco.f zhpdi.f zhpfa.f \
			zhpsl.f zpbco.f zpbdi.f zpbfa.f zpbsl.f zpoco.f \
			zpodi.f zpofa.f zposl.f zppco.f zppdi.f zppfa.f \
			zppsl.f zptsl.f zqrdc.f zqrsl.f zrotg.f zscal.f \
			zsico.f zsidi.f zsifa.f zsisl.f zspco.f zspdi.f \
			zspfa.f zspsl.f zsvdc.f zswap.f ztrco.f ztrdi.f \
			ztrsl.f

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

.PHONY: safe all remotes targets

targets:	${LIB}

all:	safe ${LIB} remotes

${LIB}:	${AllObjs}
	${AR} rvs ${LIB} $?
	${RANLIB} ${LIB}

remotes:	RemoteCopies RemoteMakes

RemoteCopies:	${SafeFiles}
	shadowcopy $?
	touch RemoteCopies

RemoteMakes:	${SafeFiles}
	shadowexec ${MAKE}
	touch RemoteMakes
#
safe:	.safe.${jdate}.Z

.safe.${jdate}.Z:	${SafeFiles}
	${MakeSafe}
#
include ${TArchDir}/included.files
#
#	How to recreate the list of include files if any of the
#	source has been changed.
#
${TArchDir}/included.files: ${AllSrcs}
	${FindIncludes}

clean:
	-rm ${TArchDir}/included.files ${AllObjs} \
	RemoteCopies RemoteMakes
