#! /bin/csh -f
# Build -- invokes Sequent Dynix "i386/tools/build", appends stdout
#  onto "Make.log", stderr tee's into stdout and, if non-zero, "Make.err"
# Note: Log files are named Make.log, Make.err, ala "Make".
#
# Bruce Jerrick, OGC CS&E.
#
# Adapted from:
# /usr/src/local/Make.csh 1.7 89/02/14 22:28:51

# See "Symmetry DYNIX V3.0.12 Utilities Sources Tape Instructions", section
#  "The Build Environment", for more info.
set BUILDARGS="-V /usr/src/dynix -M i386"
set BUILD="/usr/src/dynix/i386/tools/build"

onintr intr
set stat=0

set host=`hostname`
set temp=/tmp/Build$$

set date="`date`"
echo "============================" >>! Make.log
echo "$date" >>! Make.log
echo ${user}@${host}: build $BUILDARGS $*:q >>! Make.log

($BUILD $BUILDARGS $*:q >>! Make.log) |& tee $temp

intr:
if ( ! -z $temp ) then
	echo "============================" >>! Make.err
	echo "$date" >>! Make.err
	echo ${user}@${host}: build $BUILDARGS $*:q >>! Make.err
	cat $temp >>! Make.err
	set stat=1
endif

rm -f $temp
exit $stat
