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

# gmake Makefile for ~usp/src

#
#	make everybody
#
#	Make the libraries first - the commands may need them.
#
include ${DEPTROOT}/chd/etc/gmake.init

SafeFiles	:=	Makefile

.PHONY:	all targets remotes safe

targets:
	test -d ${DEPTROOT}/chd/bin/${TArchBinDir} || mkdir -p  ${DEPTROOT}/chd/bin/${TArchBinDir}
	(cd chd; ${MAKE} targets);
	(cd chdc; ${MAKE} targets);
	(cd chgr; ${MAKE} targets);
	(cd ctd_81; ${MAKE} targets);
	(cd dlt-info; ${MAKE} targets);
	(cd dlt-jukebox; ${MAKE} targets);
	(cd exb10i-v2; ${MAKE} targets);
	(cd exb10i-v3; ${MAKE} targets);
	(cd exbcomm; ${MAKE} targets);
	(cd knife_switch; ${MAKE} targets);
	(cd no_op; ${MAKE} targets);
	(cd opc_intx; ${MAKE} targets);
	(cd opc_token; ${MAKE} targets);
	(cd xchd; ${MAKE} targets);

all:	safe RemoteCopies
	(cd chd; ${MAKE} all);
	(cd chdc; ${MAKE} all);
	(cd chgr; ${MAKE} all);
	(cd ctd_81; ${MAKE} all);
	(cd dlt-info; ${MAKE} all);
	(cd dlt-jukebox; ${MAKE} all);
	(cd exb10i-v2; ${MAKE} all);
	(cd exb10i-v3; ${MAKE} all);
	(cd exbcomm; ${MAKE} all);
	(cd knife_switch; ${MAKE} all);
	(cd no_op; ${MAKE} all);
	(cd opc_intx; ${MAKE} all);
	(cd opc_token; ${MAKE} all);
	(cd xchd; ${MAKE} all);

remotes:	RemoteCopies
	(cd chd; ${MAKE} remotes);
	(cd chdc; ${MAKE} remotes);
	(cd chgr; ${MAKE} remotes);
	(cd ctd_81; ${MAKE} remotes);
	(cd dlt-info; ${MAKE} remotes);
	(cd dlt-jukebox; ${MAKE} remotes);
	(cd exb10i-v2; ${MAKE} remotes);
	(cd exb10i-v3; ${MAKE} remotes);
	(cd exbcomm; ${MAKE} remotes);
	(cd knife_switch; ${MAKE} remotes);
	(cd no_op; ${MAKE} remotes);
	(cd opc_intx; ${MAKE} remotes);
	(cd opc_token; ${MAKE} remotes);
	(cd xchd; ${MAKE} remotes);

install:	RemoteCopies
	(cd chd; ${MAKE} install);
	(cd chdc; ${MAKE} install);
	(cd chgr; ${MAKE} install);
	(cd ctd_81; ${MAKE} install);
	(cd dlt-info; ${MAKE} install);
	(cd dlt-jukebox; ${MAKE} install);
	(cd exb10i-v2; ${MAKE} install);
	(cd exb10i-v3; ${MAKE} install);
	(cd exbcomm; ${MAKE} install);
	(cd knife_switch; ${MAKE} install);
	(cd no_op; ${MAKE} install);
	(cd opc_intx; ${MAKE} install);
	(cd opc_token; ${MAKE} install);
	(cd xchd; ${MAKE} install);

clean:
	(cd chd; ${MAKE} clean);
	(cd chdc; ${MAKE} clean);
	(cd chgr; ${MAKE} clean);
	(cd ctd_81; ${MAKE} clean);
	(cd dlt-info; ${MAKE} clean);
	(cd dlt-jukebox; ${MAKE} clean);
	(cd exb10i-v2; ${MAKE} clean);
	(cd exb10i-v3; ${MAKE} clean);
	(cd exbcomm; ${MAKE} clean);
	(cd knife_switch; ${MAKE} clean);
	(cd no_op; ${MAKE} clean);
	(cd opc_intx; ${MAKE} clean);
	(cd opc_token; ${MAKE} clean);
	(cd xchd; ${MAKE} clean);
	-rm RemoteCopies

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

safe:	.safe.${jdate}.Z
	(cd chd; ${MAKE} safe);
	(cd chdc; ${MAKE} safe);
	(cd chgr; ${MAKE} safe);
	(cd ctd_81; ${MAKE} safe);
	(cd dlt-info; ${MAKE} safe);
	(cd dlt-jukebox; ${MAKE} safe);
	(cd exb10i-v2; ${MAKE} safe);
	(cd exb10i-v3; ${MAKE} safe);
	(cd exbcomm; ${MAKE} safe);
	(cd knife_switch; ${MAKE} safe);
	(cd no_op; ${MAKE} safe);
	(cd opc_intx; ${MAKE} safe);
	(cd opc_token; ${MAKE} safe);
	(cd xchd; ${MAKE} safe);

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

