# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.
#ident	"$Header: :mk 1.37 90/03/02 $"
#
#	Shell script for rebuilding the UNIX System
#
PARALLEL=8 export PARALLEL
SH=${SH:-sh}

trap "exit 1" 1 2 3 15
exec >makelog 2>&1

echo $ROOT
if [ "$ROOT" = "" ]
then
	PATH=/bin:/etc:/usr/bin; export PATH
	echo 
	echo "WARNING!! Don't build over the current OS!!  Very BAD idea!"
	echo 
	exit 1
fi

#       Make the libraries/cmds in parallel with the man pages and kernel

(
$SH :mkuts  						>> makelog.uts 2>&1
$SH :mklib \*						>> makelog.lib 2>&1
$SH :mkcmd $* \*					>> makelog.cmd 2>&1
$SH :mkpublic						>> makelog.public 2>&1
$SH :mkstand						>> makelog.stand 2>&1
$SH :mkbcs						>> makelog.bcs 2>&1
if [ -f :mklocale ]
then
    $SH :mklocale					>> makelog.locale 2>&1
fi
) &

if [ -f :mkman ]
then
$SH :mkman \*						>> makelog.man 2>&1 &
fi

wait

if [ -f :mkexport ]
then
$SH :mkexport all					>> makelog.exports 2>&1 
fi

exit 0
