(Thanks Alan!)
* Before attempting to use KERNOBJDIR, we now need to "make obj" in
${KERNSRCDIR}/${KERNARCHDIR}/compile, not in ${TOP}/etc as used to be
the case.
* Fix one place where getmakevar was invoked unconditionally. It needs
to be conditional on $runcmd != "echo", so that we can rely on the
existence of the new $make executable.
* Add a sanity check to getmakevar, to bomb if a similar error is
introduced in the future.
* Changed the bomb function to print to stderr instead of to stdout, and
to kill the top level shell process. Without this, an attempted bomb
from inside getmakevar did not work properly.
* Moved some duplicated code into a new safe_getmakevar function, which
calls getmakevar if that is safe, or else emits a literal '$' followed
by the variable name.
Improvements from me:
* Always 'trap "exit 1" 1 2 3 15', so the kill in bomb() doesn't cause ugly
output.
make INSTALLWORLDDIR=installworlddir installworld
after every other operation has completed.
If you want to run this target without rebuilding, use -b as well...
- Cache the output of `uname -s` and `uname -m` for future use.
* When building a kernel with the -k option, make obj in $TOP/etc to
ensure that the correct KERNOBJDIR is created and used. Previously,
KERNOBJDIR could sometimes be an objdir outside the source tree
and sometimes $TOP/sys/arch/$ARCH/compile inside the source tree,
depending on whether or not a complete build had beed done before
the kernel build.
* Renamed KERNCONFNAME to kernconfname, for consistency with what
seems to be a convention that variables local to build.sh (as
opposed to make or environment variables) have lowercase names.
* Renamed the do_buildonlytools and do_buildonlykernel variables to
do_buildtools and do_buildkernel, because the word "only" is no
longer appropriate now that more than one of them can be active
simultaneously.
* Changed a few '|| exit 1' tests to '|| bomb "message"', and added a
few more similar tests.
* Changed all 'echo "===> ..."' to use $runcmd, and added a few more
similar echos. Previously, some used $runcmd and some did not.
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.
This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.
Obsolete NBUILDJOBS; build.sh just passes -jN through to make(1),
which inherits it cooperatively through the build tree. Fix
documentation so that it's shown to be deprecated.
If you use build -jN, please save full build logs so that errors due
to missing dependancies can be analyzed and corrected.