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

# gmake Makefile for ~trcgp

#
#	make everybody
#
include ${DEPTROOT}/etc/gmake.init

SafeFiles	:=	Makefile 

.PHONY:	all targets safe

targets: 
	test -d ${DEPTROOT}/bin/${TArchBinDir} || mkdir -p  ${DEPTROOT}/bin/${TArchBinDir}
	(cd etc;	${MAKE} targets);
	(cd include;	${MAKE} targets);
	(cd man;	${MAKE} targets);
	(cd src;	${MAKE} targets);
	(cd chd;	${MAKE} targets);
	(cd usp;	${MAKE} targets);
	(cd xaprtools;	${MAKE} targets);

all:	safe RemoteCopies
	(cd bin;	${MAKE} all);
	(cd etc;	${MAKE} all);
	(cd include;	${MAKE} all);
	(cd man;	${MAKE} all);
	(cd src;	${MAKE} all);
	(cd chd;	${MAKE} all);
	(cd usp;	${MAKE} all);
	(cd xaprtools;	${MAKE} all);

remotes:  RemoteCopies
	(cd bin;	${MAKE} remotes);
	(cd etc;	${MAKE} remotes);
	(cd include;	${MAKE} remotes);
	(cd man;	${MAKE} remotes);
	(cd src;	${MAKE} remotes);
	(cd chd;	${MAKE} remotes);
	(cd usp;	${MAKE} remotes);
	(cd xaprtools;	${MAKE} remotes);

install:  RemoteCopies RemoteMakes
	(cd etc;	${MAKE} install);
	(cd include;	${MAKE} install);
	(cd man;	${MAKE} install);
	(cd src;	${MAKE} install);
	(cd chd;	${MAKE} install);
	(cd usp;	${MAKE} install);
	(cd xaprtools;	${MAKE} install);

clean:
	(cd etc;	${MAKE} clean);
	(cd include;	${MAKE} clean);
	(cd man;	${MAKE} clean);
	(cd chd;	${MAKE} clean);
	(cd usp;	${MAKE} clean);
	(cd xaprtools;	${MAKE} clean);
	(cd src;	${MAKE} clean); # moved this last so ccincl can be used
	-rm RemoteCopies ${wildcard ShdCpy*}

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

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

safe:	.safe.${jdate}.Z
	(cd bin;        ${MAKE} safe);
	(cd etc;        ${MAKE} safe);
	(cd include;    ${MAKE} safe);
	(cd man;    ${MAKE} safe);
	(cd chd;        ${MAKE} safe);
	(cd usp;        ${MAKE} safe);
	(cd xaprtools;  ${MAKE} safe);
	(cd src;        ${MAKE} safe);

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