Use /var/db/obsolete instead of /etc/obsolete
etc/Makefile:
Create separate target "install-obsolete-files" to populate
/var/db/obsolete, instead of using "install-etc-files".
Makefile:
Add do-obsolete target, to run "cd etc && make install-obsolete-files",
and add this to BUILDTARGETS.
This moves the "obsolete files" creation from "distribution" to "build".
Per discussion with Andrew Brown.
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.
The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.
This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile. Remove the now-unnecessary .keep_me files
whilst here.
Per lengthy discussion with Andrew Brown.
properly in a clean tree (bsd.subdir.mk makes the obj target in
.CURDIR depend on the recursive targets). If "make obj" is invoked a
second time, the problem will correct itself. To work around this:
(1) Before including bsd.subdir.mk, create a target called "obj-etc"
so that the "regular" one (from bsd.subdir.mk) won't be instantiated.
(2) After including bsd.obj.mk, create a "real" obj-etc target that
does the required work with .USE as a "source" so that we can merely
cons it onto the actual obj target. Note that this is only done if
the obj target has commands (ie, NOOBJ was not set and MKOBJ was not
no and whatever else you might have come up with) and we would have
recursed into etc anyway (etc is in the SUBDIR list).
This makes the obj target in src/etc get invoked *after* the obj
target in the root of the source tree so that KERNOBJDIR will have the
correct value.
Reviewed by lukem.
buildworld Builds a distribution into DESTDIR as per
"make distribution", except that DESTDIR
*must* be defined and *must not* be "" or "/".
installworld Copies (using distrib/sets/maketars -i ...) from
${DESTDIR} to ${INSTALLWORLDDIR} (defaults == `/'),
and then runs "postinstall-check" against
${INSTALLWORLDDIR}.
If ${INSTALLWORLDDIR} == "/", ensure that
`uname -s` == "NetBSD" and `uname -m` == ${MACHINE},
to prevent nasty accidents...
* Tweak some comments
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
an NFS root area for a diskless client. In such a situation, you
DO want the postinstall-check to be run.
The circumstances under which postinstall-check is now run:
* UNPRIVED is not set.
* The original target invoked was not distribution, release, or
snapshot.
There were too many synchronisation problems with using the former;
including situations such as a "make clean" performed between two
installs to the same DESTDIR would result in a truncated METALOG and
the resultant sets would be missing stuff such as include files that
don't get reinstalled if they haven't changed, even with !UPDATE.
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.
the rest of lib.
(None of lib/* needs csu installed in order to link. In the USETOOLS!=yes
case, csu may even depend on a newer libc, so installing csu before
compiling host tools in lib/ could break things even worse.)
install-info gnu subdir as it's the program updating the dir file. This
all has to happen because METALOG depends on _SRC_TOP_OBJ which is now
not defined in the top level Makefile per tv's last commit. Which is fine
as this rule should have gone into a program's Makefile anyways just like
the whatis.db one does.
not be the top level objdir, because "make obj" can happen in the *middle*
of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
_SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
in toolchain/14837). This is the root of some problems thought to be of
different causes by users who forget to say that they are using
"build.sh -j"....
file's metadata if UNPRIVED and MKINFO != no. Make afterinstall depend
on it as well as whatis.db.
XXX I wish there was a more rational place to synthesize the metadata,
but I can't think of one. The share/info/dir file is built by all the
world's install-info executions.