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

# Joe M Wade      04/01/91
 
include ${DEPTROOT}/xaprtools/etc/gmake.init
# include ${DEPTROOT}/etc/gmake.init.db
ifneq "${SOLARIS}"  ""
include ${DEPTROOT}/etc/gmake.apps.X11R6
include ${DEPTROOT}/etc/gmake.apps.motif1.2
else
include ${DEPTROOT}/etc/gmake.motif1.2
endif

# define the targets

PRGM		:=	${LocalBin}/xbtnpress

# set the architecture dependent variables

CCFlags		:=	-D_NO_PROTO -O
# CCFlags		:=	-D_NO_PROTO -DDEBUG
sunCCFlags	:=	-DSUN 
crayCCFlags	:=	-DCRAY -DNEW_MOTIF
crayFCFlags	:=      -DCRAY -i64

# sunCLFlags	:=	-Bdynamic

CommonLibes	:= 	-Bdynamic -lX11 -Bstatic -lcu
crayLibes	:= 	-lnet -lc -lsc

ifneq "${SOLARIS}"  ""
sunLibes   :=      ${sunLibes} -Bdynamic -lSM -lICE -lgen -lsocket -B dynamic \
			-ldl -B static -lform -lnsl -lintl
endif

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

CSrcs		:=	xbtnpress.c

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

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe clean targets remotes install

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

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

remotes:	RemoteCopies  RemoteMakes

RemoteCopies:	${SafeFiles}
	shadowcopy $? && touch RemoteCopies

RemoteMakes:	${SafeFiles}
	shadowexec ${MAKE} && touch RemoteMakes

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

include ${TArchDir}/included.files

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

safe:	.safe.${jdate}.Z

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

