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

include ${DEPTROOT}/xaprtools/etc/gmake.init
#include ${DEPTROOT}/etc/gmake.X11R6
include ${DEPTROOT}/etc/gmake.motif1.2


# define the targets

PRGM		:=	${LocalBin}/xcat

# set the architecture dependent variables

CCFlags		:=	${CCFlags} -D_NO_PROTO -O
sunCCFlags	:=	${sunCCFlags} -DSUN
sun4CCFlags	:=	${sun4CCFlags}
crayCCFlags	:=	${crayCCFlags} -DCRAY
crayFCFlags	:=      ${crayFCFlags} -DCRAY -i64

! sunCLFlags	:=	-Bdynamic

CommonLibes	:= 	-lxaprtools -Bdynamic -lXm -lXt -lXext -lX11 -Bstatic
crayLibes	:= 	-lc -lcu
sunLibes	:=	-lXmu -lcu
hpLibes		:=	-lcu

ifneq "${SOLARIS}"  ""
sunLibes	:=	${sunLibes} -lgen -lsocket \
			-ldl -Bstatic -lform -lnsl -lintl
endif

sunLibes   :=      -Bdynamic -lSM -lICE \
			${sunLibes}

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

CSrcs		:=	xcat.c \
			waiton.c \
			fatal.c file.c \
			HelpObject.c XuCrHelpPD.c siglu.c

SafeFiles	:=	${AllSrcs} Makefile ${wildcard *.h} xcat.pattern \
			${wildcard *.xbm} make_version xcat.1

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe clean targets remotes install

install:	targets remotes
	apps-mancopy  xaprtools 1 xcat
	apps-execopy  xaprtools prod xcat
	shadowexec -v ${MAKE} install

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

remotes:	RemoteCopies  RemoteMakes

RemoteCopies:	${SafeFiles}
	shadowcopy -R DEPT $?
	touch RemoteCopies

RemoteMakes:	${SafeFiles}
	shadowexec -R DEPT ${MAKE}
	touch RemoteMakes

version.h:
	./make_version

include ${TArchDir}/included.files

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

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

safe:	.safe.${jdate}.Z

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

