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

include ${DEPTROOT}/etc/gmake.init

# define the targets

PRGM		:=	${LocalBin}/whence

# set the architecture dependent variables

CCFlags		:=	 -g
sunCCFlags	:=	-DSUN -DUTMPX
crayCCFlags	:=	-DCRAY
crayFCFlags	:=      -DCRAY -i64

CommonLibes	:= 	
ifneq "${SOLARIS}" ""
${Vendor}Libes	:=	${${Vendor}Libes} -lnsl -lintl -Bdynamic -ldl -Bstatic
endif

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

CSrcs		:=	whence.c

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

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe targets remotes

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

remotes:	RemoteCopies  RemoteMakes

install:	RemoteCopies RemoteMakes
		shadowexec -v ${MAKE} && touch RemoteMakes

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