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

# gmake Makefile for ~usp/src/lib/uspio
# 1995/02/22	Joe Dellinger

#
#	libuspio
#
include	${DEPTROOT}/usp/etc/gmake.init
include	${DEPTROOT}/etc/gmake.as

sun4CCFlags	:=	${sun4CCFlags} -DSUN -O
crayCCFlags	:=	${crayCCFlags} -DCRAY
convexCCFlags	:=	${convexCCFlags} -re -O2
sgiFCFlags	:=	${sgiFCFlags} -OPT:const_copy_limit=17000 \
			-OPT:global_limit=17000

sun4FCFlags	:=	${sun4CCFlags} -DNODEBUG -DSUN -O4 -nodoc
crayFCFlags	:=	${crayCCFlags} -DCRAY -i 64 -dp -astack -nodoc
convexCCFlags	:=	${convexCCFlags} -re -O2

LIB		:=	${LocalLib}/libuspio.a

ASrcs		:=	${${TArchDir}ASrcs}

F77Srcs		:=	uspc1cmp.F uspclall.F uspcleanslate.F uspclose.F \
			uspcmcmp.F uspinput.F uspinsum.F uspioinit.F \
			uspmctrsp.F uspmic.F uspoutput.F usppass.F usprlhdr.F \
			usprtrace.F usprwtrace.F uspseek.F uspsinput.F \
			uspsoutput.F uspdeadtrace.F

CSrcs           :=	lucfd.c usptba.c sisbufsz.c lucrw.c cstubs.c


SafeFiles	:=	${F77Srcs} ${CSrcs} ${ASrcs} \
			${sunF77Srcs} ${cray2ASrcs} Makefile \
			${wildcard *.h}


${LIB}:  ${F77Objs} ${CObjs} ${AObjs}
	rm -f ${LIB}
	${AR} r ${LIB} ${F77Objs} ${CObjs} ${AObjs}
	${RANLIB} ${LIB}

.PHONY:	all remotes safe targets

targets:	${LIB}

all :	safe targets remotes

remotes:	RemoteCopies RemoteMakes

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

RemoteMakes:	${SafeFiles}
	shadowexec ${MAKE}
	touch RemoteMakes

include	${TArchDir}/included.files

${TArchDir}/included.files: ${AllSrcs}
	${FindIncludes}

safe:	.safe.${jdate}.Z

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

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