########################################################################
#                 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}/mgdiff

# set the architecture dependent variables

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

sunCLFlags	:=	-Bdynamic

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

ifneq "${SOLARIS}"  ""
sunLibes   :=      ${sunLibes} -lgen -lsocket -B dynamic -R /usr/lib/X11R5 \
			-ldl -B static -lform -lnsl -lintl
endif

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

CSrcs		:=	mgdiff.c rundiff.c misc.c files.c \
			spawn.c manual.c modal.c legend.c

SafeFiles	:=	${AllSrcs} Makefile ${wildcard *.h} mgdiff.1 \
			${wildcard *.xbm} ${wildcard *.xpm}

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe clean targets remotes install

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

remotes:	RemoteCopies  RemoteMakes

install:
	mancopy 1 mgdiff
	execopy  mgdiff
	shadowexec -v ${MAKE} install

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

RemoteMakes:	${SafeFiles}
	shadowexec -R DEPT ${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*}
