Subject: Retiring NBUILDJOBS in favor of just using -j..
To: None <tech-toolchain@netbsd.org>
From: Bill Sommerfeld <sommerfeld@netbsd.org>
List: tech-toolchain
Date: 04/28/2002 15:58:45
So, NBUILDJOBS was introduced a long time ago as a "hack" to allow
partial parallelism -- because "make -jN" at the top level didn't do
the right thing, only the "2nd level" makes (i.e., in lib, bin,
usr.bin) etc., would be run in parallel.

The changes I committed to make well over a year ago, and some of the
makefile changes made since then remove the need for it -- you can
just do a "make -jN build" at top level and the right thing happens.

I'd like to make the following change to build.sh so build.sh -j
passes the parallelism argument directly to the top-level make:

--- build.sh    2002/04/18 01:38:11     1.56
+++ build.sh    2002/04/28 19:50:52
@@ -151,7 +151,7 @@
        -d)     buildtarget=distribution;;
 
        -j)     eval $optargcmd
-               MAKEFLAGS="$MAKEFLAGS NBUILDJOBS=$OPTARG"; export MAKEFLAGS;;
+               parallel="-j $OPTARG";;
 
        # -m overrides MACHINE_ARCH unless "-a" is specified
        -m)     eval $optargcmd
@@ -384,10 +384,10 @@
 $runcmd chmod +x "$makewrapper"
 
 if $do_buildsystem; then
-       ${runcmd-exec} "$makewrapper" $buildtarget
+       ${runcmd-exec} "$makewrapper" $parallel $buildtarget
 elif $do_buildonlytools; then
        if [ "$MKOBJDIRS" != "no" ]; then
-               $runcmd "$makewrapper" obj-tools || exit 1
+               $runcmd "$makewrapper" $parallel obj-tools || exit 1
        fi
        $runcmd cd tools
        if [ "$UPDATE" = "" ]; then

.. and we can then remove the NBUILDJOBS logic from the top-level
makefile.

					- Bill