* 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.
using `uname -s`-`uname -r`-`uname -p || uname -m`. This can be overridden
in mk.conf or the environment, and is used by host tools to ensure that
build hosts do not clobber each other.
* Now that there's an objdir in src/tools, make a default TOOLDIR by creating
"tools.${HOST_OSTYPE}" in the objdir (if it exists) of src/tools. This
means that TOOLDIR is no longer required to be set in a build, though it
still may be set manually if desired.
* Set MKTOOLS to "yes" by default, since the default TOOLDIR is now located
in a known mutable location. This may still be set manually if desired.
defined, as <bsd.own.mk> always sets it; also, compare only against "yes"
(not "no") for a yes/no check, as there are two negative states ("no" and
"never").
just don't build the tools if USETOOLS!=yes. This permits objdirs to
be created even when USETOOLS=no.
* Clean up use of "-m" by specifying it to .MAKEFLAGS: if needed.
lazy evaluation semantics, not the "assign it now" semantics. This
allows variables used in the program's CPPFLAGS to get the correct
values of e.g. MACHINE, MACHINE_ARCH, MACHINE_CPU, etc.
Problem was notices when propagating MACHINE and MACHINE_ARCH via
MAKEFLAGS (i.e. from the command line, rather than the environment).
For this to work, make sure you <bsd.hostprog.mk> is at least rev 1.15.
Only descend into directories if USE_NEW_TOOLCHAIN is set (allows top level
Makefile to use "-m ${.CURDIR}/share/mk" to get the "correct" <bsd.own.mk>
when descending into src/tools/Makefile).
in the rest of the source tree, for reasons that will be documented separately.
Short story: host tools that are out of date need to be rebuilt
*from scratch* to avoid our common `source skew accidents'.