#!/bin/sh
# $Id: 2.buildworld.sh,v 1.15 2004/10/15 20:45:19 saturnero Exp $                     

set -e -u

. ./config.sh
. ./.common.sh

echo "Building world..."
sleep 1
echo "\"This may take a while, go get some runts...\""

if [ "x$MINIMAL" = "xYES" ]; then
    export __MAKE_CONF=$LOCALDIR/files/make.conf.minimal # Redefine make.conf path
else
    export __MAKE_CONF=$LOCALDIR/files/make.conf # Redefine make.conf path
fi

rm -rf ${MAKEOBJDIRPREFIX:-/usr/obj}/usr || print_error
cd /usr/src || print_error
make cleandir || print_error
$MAKE buildworld $MAKEOPT || print_error
