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

# gmake makefile for usp program.
# 09/27/89	Terri Fischer

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

sun4cg92Libes	:= ${sun4cg92Libes} -lnsl
CommonLibes	:= ${CommonLibes} -lcu -lcsm -lut -lieeeio -lm
Libes 		:= ${CommonLibes} ${${TArchDir}Libes} ${${Vendor}Libes}

sun3CCFlags	:=	${sun3CCFlags} -DSUN -O
sun3fpaCCFlags	:=	${sun3fpaCCFlags} -DSUN -ffpa -O
sun4CCFlags	:=	${sun4CCFlags} -DSUN -O
crayCCFlags	:=	${crayCCFlags} -DCRAY -O2 -h stdc
hpCCFlags	:=	${hpCCFlags} -Ae

ifeq "${Vendor}" "sun"
ifdef SOLARIS
CC := cc
else
CC := acc
endif
endif

CSrcs		:= dmovz.c

SafeFiles	:= ${AllSrcs} ${wildcard *.1} Makefile  dmovz.pattern

PRGM		:= ${LocalBin}/dmovz

targets : ${PRGM}

all :  safe clean targets remotes

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

purify:  ${CObjs}
	purify ${LinkC} -o /tmp/dmovz ${CObjs} ${Libes}

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

remotes:	RemoteCopies RemoteMakes

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

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

safe:	.safe.${jdate}.Z

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

include ${TArchDir}/included.files

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


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