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

include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.motif1.2

# define the targets

PRGM		:=	${LocalBin}/xcram_read

# set the architecture dependent variables

CCFlags		:=	-D_NO_PROTO
sunCCFlags	:=	-DSUN

Libes	:= 	-lXm -lXt -lX11

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

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

LIBES           :=      ${Libes} ${${Vendor}Libes}

CSrcs		:=	main.c callbacks.c xcram_read.c

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

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe targets remotes

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

install:
	execopy xcram_read
#	shadowexec -v ${MAKE} install

remotes:	RemoteCopies  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*}
