#!/bin/csh
## !/bin/tcsh
#From: "Michael L. VanLoon -- HeadCandy.com" <michaelv@HeadCandy.com>
#Sender: owner-current-users@NetBSD.ORG
#Precedence: list
#X-Loop: current-users@NetBSD.ORG
#X-Status: 
#
#
#>[ On Thu, March  2, 1995 at 04:52:17 (-0800), Alistair G. Crooks wrote: ]
#>> Due to some masochistic compulsion, I've just done this, and these
#>> are the steps that I used (on the i386 platform):
#
#>Why doesn't the top level Makefile do all of this properly (assuming you
#>select the right pseudo-target for it to build)?
#
#Because, I believe, the top-level Makefile is designed to rebuild a
#static system (like one of the releases).  It is not intended as a
#tool for upgrading to interum sources.
#
#I have a script I wrote that seems to do everything fairly well.  I
#don't know if it is capable of correctly building a system that is
#severely behind current, but it works excellently for keeping current
#with the on-going development sources.
#
#For your amusement, here it is:
#
#---------- >8 ----- begin /usr/src/utils/doall ----- 8< ----------
# .cleanafter  Cleanup after subsystem build, save on disk space :-)! 
# .dosup       Do a sup of the sources
# .noclean     Do not do a make clean before building
# .buildgcc    Rebuild gcc ld, as before building anything else 
source /root/bin/rebuild_setenv

# Config filename:
set CONFIGLOCAL='FREETOCREATE'
set CONFIG='GENERIC'

/root/bin/rebuild_tobin
/root/bin/rebuild_bin

echo "    making sys libraries... (`date`)" >> $LOGFILE
cd /usr/src/sys/
echo "        make clean, obj... (`date`)" >> $LOGFILE
make clean obj
echo "        make depend... (`date`)" >> $LOGFILE
make depend
echo "        make... (`date`)" >> $LOGFILE
make
echo "        make install... (`date`)" >> $LOGFILE
make install

echo "Finished main build (`date`)" >> $LOGFILE

# Run custom kernel build script:
/root/bin/doconfig $CONFIG
/root/bin/doconfig $CONFIGLOCAL

/usr/libexec/makewhatis

echo "Finished rebuild_netbsd (`date`)" >> $LOGFILE
#ldconfig $ldconfigpath
#     ---------- >8 -----  end /usr/src/utils/doall  ----- 8< ----------
#
#-----------------------------------------------------------------------------
#  Michael L. VanLoon                                 michaelv@HeadCandy.com
#       --<  Free your mind and your machine -- NetBSD free un*x  >--
#     NetBSD working ports: 386+PC, Mac, Amiga, HP300, Sun3, Sun4, PC532,
#                           DEC pmax (MIPS R2k/3k), DEC/AXP (Alpha)
#     NetBSD ports in progress: VAX and others...
#-----------------------------------------------------------------------------


