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

# gmake Makefile for ~usp
# 89/05/09	Bill Done
# 89/06/26	Terri Fischer -- added Ctvf
# 92/02/03	Joe Wade -- put in every subdirectory which contained source

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

SafeFiles	:=	Makefile 

.PHONY:	all targets safe

targets:
	test -d ${DEPTROOT}/usp/bin/${TArchBinDir} || mkdir -p ${DEPTROOT}/usp/bin/${TArchBinDir}
	(cd etc;	${MAKE} targets);
	(cd include;	${MAKE} targets);
	(cd man;	${MAKE} targets);
	(cd src;	${MAKE} targets);
#	(cd fmah;	${MAKE} targets);
	(cd 3d;		${MAKE} targets);
#	(cd CALPLOT;	${MAKE} targets);
	(cd CEP;	${MAKE} targets);
	(cd Converted;	${MAKE} targets);
	(cd DMO;	${MAKE} targets);
	(cd Datum;	${MAKE} targets);
#	(cd Delft;	${MAKE} targets);
#	(cd Kennett;	${MAKE} targets);
	(cd Mig;	${MAKE} targets);
	(cd Ncomp;	${MAKE} targets);
	(cd Opst;	${MAKE} targets);
	(cd Poln;	${MAKE} targets);
#	(cd Radon;	${MAKE} targets);
	(cd Reflect;	${MAKE} targets);
	(cd Syna;	${MAKE} targets);
	(cd Taup;	${MAKE} targets);
	(cd Tomography;	${MAKE} targets);
#	(cd bgs;	${MAKE} targets);
#	(cd contrib;	${MAKE} targets);

all:	safe RemoteCopies
	(cd etc;	${MAKE} all);
	(cd include;	${MAKE} all);
	(cd man;	${MAKE} all);
	(cd src;	${MAKE} all);
#	(cd fmah;	${MAKE} all);
	(cd 3d;		${MAKE} all);
#	(cd CALPLOT;	${MAKE} all);
	(cd CEP;	${MAKE} all);
	(cd Converted;	${MAKE} all);
	(cd DMO;	${MAKE} all);
	(cd Datum;	${MAKE} all);
#	(cd Delft;	${MAKE} all);
#	(cd Kennett;	${MAKE} all);
	(cd Mig;	${MAKE} all);
	(cd Ncomp;	${MAKE} all);
	(cd Opst;	${MAKE} all);
	(cd Poln;	${MAKE} all);
#	(cd Radon;	${MAKE} all);
	(cd Reflect;	${MAKE} all);
	(cd Syna;	${MAKE} all);
	(cd Taup;	${MAKE} all);
	(cd Tomography;	${MAKE} all);
#	(cd bgs;	${MAKE} all);
#	(cd contrib;	${MAKE} all);

remotes:  RemoteCopies
	(cd etc;	${MAKE} remotes);
	(cd bin;	${MAKE} remotes);
	(cd include;	${MAKE} remotes);
	(cd man;	${MAKE} remotes);
	(cd src;	${MAKE} remotes);
#	(cd fmah;	${MAKE} remotes);
	(cd 3d;		${MAKE} remotes);
#	(cd CALPLOT;	${MAKE} remotes);
	(cd CEP;	${MAKE} remotes);
	(cd Converted;	${MAKE} remotes);
	(cd DMO;	${MAKE} remotes);
	(cd Datum;	${MAKE} remotes);
#	(cd Delft;	${MAKE} remotes);
#	(cd Kennett;	${MAKE} remotes);
	(cd Mig;	${MAKE} remotes);
	(cd Ncomp;	${MAKE} remotes);
	(cd Opst;	${MAKE} remotes);
	(cd Poln;	${MAKE} remotes);
#	(cd Radon;	${MAKE} remotes);
	(cd Reflect;	${MAKE} remotes);
	(cd Syna;	${MAKE} remotes);
	(cd Taup;	${MAKE} remotes);
	(cd Tomography;	${MAKE} remotes);
#	(cd bgs;	${MAKE} remotes);
#	(cd contrib;	${MAKE} remotes);

install:  RemoteCopies RemoteMakes
	(cd etc;	${MAKE} install);
	(cd include;	${MAKE} install);
	(cd man;	${MAKE} install);
	(cd src;	${MAKE} install);
#	(cd fmah;	${MAKE} install);
	(cd 3d;		${MAKE} install);
#	(cd CALPLOT;	${MAKE} install);
	(cd CEP;	${MAKE} install);
	(cd Converted;	${MAKE} install);
	(cd DMO;	${MAKE} install);
	(cd Datum;	${MAKE} install);
#	(cd Delft;	${MAKE} install);
#	(cd Kennett;	${MAKE} install);
	(cd Mig;	${MAKE} install);
	(cd Ncomp;	${MAKE} install);
	(cd Opst;	${MAKE} install);
	(cd Poln;	${MAKE} install);
#	(cd Radon;	${MAKE} install);
	(cd Reflect;	${MAKE} install);
	(cd Syna;	${MAKE} install);
	(cd Taup;	${MAKE} install);
	(cd Tomography;	${MAKE} install);
#	(cd bgs;	${MAKE} install);
#	(cd contrib;	${MAKE} install);

clean:  
	(cd etc;	${MAKE} clean);
	(cd bin;	${MAKE} clean);
	(cd include;	${MAKE} clean);
	(cd man;	${MAKE} clean);
	(cd src;	${MAKE} clean);
#	(cd fmah;	${MAKE} clean);
	(cd 3d;		${MAKE} clean);
#	(cd CALPLOT;	${MAKE} clean);
	(cd CEP;	${MAKE} clean);
	(cd Converted;	${MAKE} clean);
	(cd DMO;	${MAKE} clean);
	(cd Datum;	${MAKE} clean);
#	(cd Delft;	${MAKE} clean);
#	(cd Kennett;	${MAKE} clean);
	(cd Mig;	${MAKE} clean);
	(cd Ncomp;	${MAKE} clean);
	(cd Opst;	${MAKE} clean);
	(cd Poln;	${MAKE} clean);
#	(cd Radon;	${MAKE} clean);
	(cd Reflect;	${MAKE} clean);
	(cd Syna;	${MAKE} clean);
	(cd Taup;	${MAKE} clean);
	(cd Tomography;	${MAKE} clean);
#	(cd bgs;	${MAKE} clean);
#	(cd contrib;	${MAKE} clean);
	-rm RemoteCopies RemoteMakes ${wildcard ShdCpy*}

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

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

safe:	.safe.${jdate}.Z
	(cd etc;	${MAKE} safe);
	(cd bin;	${MAKE} safe);
	(cd include;	${MAKE} safe);
	(cd man;	${MAKE} safe);
	(cd src;	${MAKE} safe);
#	(cd fmah;	${MAKE} safe);
	(cd 3d;		${MAKE} safe);
#	(cd CALPLOT;	${MAKE} safe);
	(cd CEP;	${MAKE} safe);
	(cd Converted;	${MAKE} safe);
	(cd DMO;	${MAKE} safe);
	(cd Datum;	${MAKE} safe);
#	(cd Delft;	${MAKE} safe);
#	(cd Kennett;	${MAKE} safe);
	(cd Mig;	${MAKE} safe);
	(cd Ncomp;	${MAKE} safe);
	(cd Opst;	${MAKE} safe);
	(cd Poln;	${MAKE} safe);
#	(cd Radon;	${MAKE} safe);
	(cd Reflect;	${MAKE} safe);
	(cd Syna;	${MAKE} safe);
	(cd Taup;	${MAKE} safe);
	(cd Tomography;	${MAKE} safe);
#	(cd bgs;	${MAKE} safe);

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