########################################################################
#                 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
CommonLibes     :=      -lxaprtools -lXm -lXt -lX11 -lm -lcu
sunLibes        +=      -lXmu
intelLibes      +=      -lXmu -lXext
crayLibes       +=      -lc
hpLibes         :=      

ifneq "${SOLARIS}"  ""
sunLibes   :=      ${sunLibes} -lSM -lICE -lgen -lsocket -B dynamic \
			-ldl -B static -lform -lnsl -lintl
CommonLibes :=	 -Bdynamic ${CommonLibes}
endif
 
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}

