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

#
#	This Makefile will not work with the
#	pre-SunPro version of make (i.e., any
#	pre-SunOS 3.5 default installation).
#
#	ARCH must be set in the environment
#	to the architecture type of the machine,
#	e.g., sun3, sun4, etc., and a subdirectory
#	of the same name must be present in this
#	source directory.
#
#	FLOAT may optionally be set in the
#	environment to an appropriate floating
#	point compile flag, e.g., -f68881, -ffpa, etc.
#
# 90/7/9      Joe M. Wade

ifeq "${TARCH}" "IRIX64"
TargetArch := -IRIX32
endif

include	${DEPTROOT}/usp/etc/gmake.init
include	${DEPTROOT}/etc/gmake.motif1.2

sunCCFlags	:=	-DSUN -Dsun4 -O
sun4u-SC4CCFlags :=	${sun4u-SC4CCFlags} -D_BSD -Dnotdef
hpCCFlags	:=	${hpCCFlags} -D_BSD -Dnotdef
IRIX64CCFlags	:=	${IRIX64CCFlags} -O -D_BSD -Dnotdef
IRIX32CCFlags	:=	${IRIX32CCFlags} -O -D_BSD -Dnotdef
convexCCFlags	:=	${convexCCFlags} -O -p -D_BSD -pcc
rs6000CCFlags	:=	${rs6000CCFlags} -O -D_BSD

TROFF=	ptroff

CSrcs	:=	bufio.c token.c getdtablesize.c getwd.c

LIB	:=	${LocalLib}/libikp.a

SafeFiles	:= ${AllSrcs} Makefile

targets:	${LIB}

all:	doc safe targets remotes

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


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}
	${FindIncludes}

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