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

#
#	make everybody
#
#	This supports:	targets	- the target programs on this machine
#			all	- everything you can do including remotes.
#
#	So everybody is going to have to support targets and all (or
#	not pass them down).
#
include	${DEPTROOT}/etc/gmake.init

.PHONY:	targets remotes all

targets: 
	test -d ${DEPTROOT}/lib/${TArchDir} || mkdir -p ${DEPTROOT}/lib/${TArchDir}
	(cd cu; ${MAKE} targets);
	(cd fu; ${MAKE} targets);
	(cd mathadv; ${MAKE} targets);
	(cd linpack; ${MAKE} targets);
	(cd xtb; ${MAKE} targets);
	(cd Xgoodies; ${MAKE} targets);
	(cd XmCreateVa; ${MAKE} targets);

remotes: RemoteCopies
	(cd cu; ${MAKE} remotes);
	(cd fu; ${MAKE} remotes);
	(cd linpack; ${MAKE} remotes);
	(cd mathadv; ${MAKE} remotes);
	(cd xtb; ${MAKE} remotes);
	(cd Xgoodies; ${MAKE} remotes);
	(cd XmCreateVa; ${MAKE} remotes);

all:	safe clean targets remotes 
	(cd cu; ${MAKE} all);
	(cd fu; ${MAKE} all);
	(cd linpack; ${MAKE} all);
	(cd mathadv; ${MAKE} all);
	(cd xtb; ${MAKE} all);
	(cd Xgoodies; ${MAKE} all);
	(cd XmCreateVa; ${MAKE} all);

clean:
	(cd cu; ${MAKE} clean);
	(cd fu; ${MAKE} clean);
	(cd linpack; ${MAKE} clean);
	(cd mathadv; ${MAKE} clean);
	(cd xtb; ${MAKE} clean);
	(cd Xgoodies; ${MAKE} clean);
	(cd XmCreateVa; ${MAKE} clean);
	-rm RemoteCopies ${wildcard ShdCpy*}

RemoteCopies:	Makefile
	shadowcopy $? && touch RemoteCopies

SafeFiles := Makefile

safe: .safe.${jdate}.Z
	(cd cu; ${MAKE} safe);
	(cd fu; ${MAKE} safe);
	(cd mathadv; ${MAKE} safe);
	(cd linpack; ${MAKE} safe);
	(cd xtb; ${MAKE} safe);
	(cd Xgoodies; ${MAKE} safe);
	(cd XmCreateVa; ${MAKE} safe);

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