#! /bin/csh
#
# This script updates a copy of tools and installs the result in tools.core
set DESTDIR  = /home/gropp/port/tools.core
set FINALDIR = /home/gropp/tools.core
set TOOLSDIR = /home/gropp/tools.n
alias cd 'cd'
#
if ($#argv > 0) then
    if ("$1" == "-help") then
        echo "$0"
        echo "Updates the current version of tools by using the file"
	echo "lastupdate to determine what files to update.  It then"
	echo "builds new object libraries for a variety of machines."
	echo "This script is hardwired for the Argonne Development copy;"
	echo "if you wish to use it to update or maintain your distribution"
	echo "version you will need to make extensive changes."
        exit 1
    endif
endif
cd $TOOLSDIR
#
# Generate the update
./bin/update lastupdate
/bin/mv new.tar $DESTDIR
touch lastupdate
cd $DESTDIR
tar xf new.tar
./bin/install -finaldir $FINALDIR >&sun4.log
# lunch = rs6000
# lepido = tc2000 
# krazny = IRIX(SGI)
foreach host (lunch lepido krazny)
	rsh -n $host "( cd $DESTDIR ; ./bin/install -libs O -noman -finaldir $FINALDIR >& $host.log )"
	rsh -n $host "( cd $DESTDIR ; ./bin/install -libs g -noman -finaldir $FINALDIR >& $host.log )"
end
#
# At this point, we should move the libraries to their resting point
# and us "at" to resubmit this to run the next evening at 7:00pm.
#
#/bin/mv $FINALDIR/libs $FINALDIR/libs.old
#/bin/cp -rp libs       $FINALDIR/libs
#/bin/rm -rf $FINALDIR/libs.old
#
#at 7:00pm <<.
#$TOOLSDIR/bin/updtools
#.
