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

# gmake makefile for ikpd program.
# 07/09/90   joe m. wade

TARCH := ${shell ${DEPTROOT}/bin/tarch}
ifeq "${TARCH}" "IRIX64"
TargetArch := -IRIX32
endif

include ${DEPTROOT}/usp/etc/gmake.init
#include ${DEPTROOT}/etc/gmake.X11R5
include ${DEPTROOT}/etc/gmake.motif2.0

CommonLibes	:=	${CommonLibes} -likp -lm -lcu
ifneq "${SOLARIS}" ""
sunLibes	:= 	-lgen -lsocket -B dynamic -ldl -B static  -lform -lnsl -lintl
endif

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

sunCCFlags	:=	${sunCCFlags} -DSUN -O
crayCCFlags	:=	${crayCCFlags} -DCRAY
convexCCFlags	:=	${convexCCFlags} -pcc
hpCCFlags	:=	${hpCCFlags} -O -Dnotdef
IRIX32CCFlags	:=	${IRIX32CCFlags} -O -Dnotdef
IRIX64CCFlags	:=	${IRIX64CCFlags} -O -Dnotdef
sun4cg89CCFlags	:=	${sun4cg89CCFlags}
sun4cg92CCFlags	:=	${sun4cg92CCFlags}
sun4cg89CLFlags	:=	${sun4cg89CLFlags} -Bdynamic
sun4cg92CLFlags	:=	${sun4cg92CLFlags} -Bstatic

# sun4CLFlags	:=	${sun4CLFlags} -Bstatic

CSrcs		:= ikpd.c ikpd_ops.c

# chkfds.c chkfd3.c

SafeFiles	:= ${AllSrcs} Makefile

PRGM		:= ${LocalBin}/in.ikpd

targets : ${PRGM}

all :  safe clean targets remotes install

${PRGM}    :  ${AllObjs}
	${LinkC} -o $@ ${AllObjs} ${Libes}

remotes:	RemoteCopies RemoteMakes

install:
	mancopy 1 in.ikpd
	execopy  in.ikpd
	shadowexec -v ${MAKE} install

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} ${PRGM} RemoteCopies RemoteMakes ${wildcard ShdCpy*}
