* Rewrite src/tools Make logic to work like the rest of the tree wrt
"dependall" and "install". The old "make build" hack is gone.
* Remove the MKTOOLS logic. This was linked to the "make build" hack,
and was only needed because TOOLDIR originally had no writable default.
* Redo the GNU configure/make logic to make it fit reasonably in a
BSD make wrapper. Use new ${.ALLTARGETS} variable to scan for
targets in $(srcdir), and mark them with .MADE: to prevent rebuilding.
* Only build cross tools in src/tools; remove some messy logic in
src/usr.* and src/gnu/usr.* that would do target filename rewriting
(improves consistency and readability).
* Add the ability to build cross gdb at tool build time by setting
MKCROSSGDB (default no) to "yes" in mk.conf.
* Add src/tools/groff and set up paths to work with this cross groff.
build.sh just get lost if they differ from a previous invocation (i.e. letting
MKOBJDIRS get set the first time, -o will get ignored after this unless a
rebuild of the script happens). It's low overhead so this adds little burden
to getting it right.
$TOOLDIR and $DESTDIR in their expanded form.
* Set USETOOLS=yes in the make wrapper script; it's pretty pointless
using the make wrapper unless you're using the host tools.
* In the -t case, make sure to only echo the "make obj" command if -n.
* Set stuff mostly in the environment, not on make(1)'s command line.
This is needed for MACHINE and MACHINE_ARCH (noted by bjh21), and keeps
the mk.conf-overriding-env behavior (suggested by several people).
* Use MAKEFLAGS to make the wrapper script more readable.
* When prepping objdir in tools for the default TOOLDIR value, just make
that objdir; leave the recursive "make obj" for later.
* Allow MACHINE to be set automatically on NetBSD native builds.
Require -m only if the host is not NetBSD.
* Fail if DESTDIR is set to root (/) and the build is not NetBSD native,
or the build is attempting a "make release" (option -R).
* Warn the user if DESTDIR is set to root (/) that the kernel must be up
to date, or else the build might hose the system. Also, do not remove
DESTDIR on -r if it is set to root.
* Fail if TOOLDIR is set to / or empty after checking with nbmake.
* Allow DESTDIR and TOOLDIR to be set in mk.conf and/or by the new default
from <bsd.own.mk>. Note that if -T is not used to set TOOLDIR, and
TOOLDIR is not set in the environment, then nbmake will always be
bootstrapped (rather than looking at nbmake's timestamp). This is
because /bin/sh doesn't know how to get TOOLDIR from mk.conf without
first having nbmake (...which lives in TOOLDIR).
* Do a pass of "make obj" through src/tools before installing nbmake (so
long as -o/MKOBJDIRS=no is not specified). This ensures that objdirs
exist if they are desired, and paves the way for using build.sh to
build all the src/tools without building everything else.
* Add "-w" option, which allows the builder to specify where the nbmake
wrapper shell script should be created. If not specified,
$TOOLDIR/bin/nbmake-$MACHINE is still created as a default.
* Print the values of DESTDIR and TOOLDIR after bootstrapping nbmake,
for informational purposes.
It should now be possible to type just "./build.sh" on a NetBSD-current
host and get a new build in / for the appropriate architecture.
However, building in-place like this has *not* been extensively tested
yet, so be careful.
quoting, so the commands were thought to be one big word with embedded
whitespace)
* New options:
-O obj Set root of an obj tree; sets MAKEOBJDIR to an appropriate
substitution pattern.
-o Sets MKOBJDIRS=no (otherwise sets MKOBJDIRS=yes)
-u Sets UPDATE
* Don't require DESTDIR when -b is set.
* Add -n option, which prints the commands that would be run by build.sh,
but doesn't run them (much like make's -n option).
* Auto-resolve relative paths for -D, -R, and -T (but not for the
corresponding environment variables).
* Explicitly declare defaults of all shell variables used where feasible,
rather than sprinkling ${varname-value} expansions.
* Prefix shell true/false variables with "do_" to indicate their use as
actual values in shell expressions (like "$do_buildsystem && echo foo").