funny that :), and call in "distribution" just before the "make checkflist".
Should minimise a bunch of the "I use make UPDATE= and checkflist failed"
errors, but not all of them.
program/tool from "FOO" to "TOOL_FOO". The new variables are:
TOOL_ASN1_COMPILE TOOL_CAP_MKDB TOOL_CAT TOOL_CKSUM TOOL_COMPILE_ET
TOOL_CONFIG TOOL_CRUNCHGEN TOOL_CTAGS TOOL_DB TOOL_EQN TOOL_FGEN
TOOL_GENCAT TOOL_GROFF TOOL_HEXDUMP TOOL_INDXBIB TOOL_INSTALLBOOT
TOOL_INSTALL_INFO TOOL_M4 TOOL_MAKEFS TOOL_MAKEINFO TOOL_MAKEWHATIS
TOOL_MDSETIMAGE TOOL_MENUC TOOL_MKCSMAPPER TOOL_MKESDB
TOOL_MKLOCALE TOOL_MKMAGIC TOOL_MKTEMP TOOL_MSGC TOOL_MTREE
TOOL_PAX TOOL_PIC TOOL_PREPMKBOOTIMAGE TOOL_PWD_MKDB TOOL_REFER
TOOL_ROFF_ASCII TOOL_ROFF_DVI TOOL_ROFF_HTML TOOL_ROFF_PS
TOOL_ROFF_RAW TOOL_RPCGEN TOOL_SOELIM TOOL_SUNLABEL TOOL_TBL
TOOL_UUDECODE TOOL_VGRIND TOOL_ZIC
For each, provide default in <bsd.sys.mk> of the form:
TOOL_FOO?= foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
TOOL_FOO= ${TOOLDIR}/bin/${_TOOL_PREFIX}foo
Document all of these in bsd.README.
This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
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.
* 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.
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.
for broken builds is to fix the relevant Makefiles as was done for sparc.
This was done in the interest of simplicity of the system build (and the
fact that there may be a need to descend into these directories in the
near future).
subdir list as anything building into them will access them directly (ala
the make release rule or the mtree rule). There were good reasons for
controlling this at the top level before and those should remain in place.
On cleandir and obj builds these should get run through but that's it for
the "normal" rule sets. (This was breaking the builds as make includes doesn't
function inside of distrib for instance).
${USETOOLS} != "no"
to
${USETOOLS} == "yes"
to allow USETOOLS to be tri-state: "yes", "no", or "never". The use of
these options will be documented in src/BUILDING.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
variable TRUE defined in our makefile system.
This prevents "make includes" from breaking with older bsd.subdir.mk, and is
more consistent with the uses of "true" in the rest of the tree.
"make cleandir". Fixes PR bin/14177.
"make build"'s logic and the conventional <bsd.subdir.mk> logic probably
need to be split apart here at some point to prevent these kinds of things
from causing odd problems in the future....
file in order to get proper definitions for a build. (Temporary; this
Makefile will be moved to a new name and replaced with a bootstrap Makefile
in the near future.)
i386 platform builds must now set TOOLDIR in mk.conf or the
environment in order to build the system. This is a pathname
where host build tools will be installed, and must NOT be
the same as src/tools.
(Optionally, USETOOLS=no can be set in the environment if you
wish to avoid using the separate host toolchain for building a
subtree. Otherwise, this will default to "yes" automatically.)
However, building with USETOOLS=no set and no defined TOOLDIR ends up
with breakage, as the do-make-tools target is run regardless of whether
or not USETOOLS is set.
Hence, a wrapper around the body of the do-make-tools target:
.if ${USETOOLS} != "no"
...
.endif
...which makes the build work when USETOOLS=no, with no TOOLDIR set. This
would seem to more accurately match the description put forth in UPDATING.
In the new build world order, DESTDIR is set to "" (in Makefile.tools)
if not already set, to ensure correct include/library handling. This
caused the top-level to not set DESTDIR=/, which confused distrib-dirs,
since it doesn't include Makefile.tools, and thus didn't see the same
DESTDIR that the top-level did.
set, will descend into "tools" to build a toolchain, and use that toolchain
explicitly for the build (via tools/Makefile.tools).
While here, GC all the "egcs-detection" logic; it's not needed anymore, since
nothing is on gcc 2.7 any longer.
comments in src/Makefile):
# Sub targets of `make build,' in order:
# buildstartmsg: displays the start time of the build.
# beforeinstall: creates the distribution directories.
# do-force-domestic: check's that FORCE_DOMESTIC isn't set (deprecated.)
# do-share-mk: installs /usr/share/mk files.
# do-cleandir: clean's the tree.
# do-make-obj: create's object directories if required.
# do-check-egcs: check's that we have a modern enough compiler (deprecated.)
# do-make-includes: install include files.
# do-lib-csu: build & install startup object files.
# do-lib: build & install system libraries.
# do-gnu-lib: build & install gnu system libraries.
# do-dependall: builds & install the entire system.
# do-domestic: build & install the domestic tree (deprecated.)
# do-whatisdb: build & install the `whatis.db' man database.
# buildendmsg: displays the end time of the build.
this is something i've wanted to do for years....
adding support for Heimdal/KTH Kerberos where easy to do so. Eliminate
bsd.crypto.mk.
There is still a bunch more work to do, but crypto is now more-or-less
fully merged into the base NetBSD distribution.
overrideable in mk.conf
Document in bsd.README; this is distinct from "MKOBJ", which controls
whether "make obj" does anything.
In the top-level makefile, if MKOBJDIRS != "no", do a "make obj" at an
appropriate point during a "make build".
and 'install' targets to descend into the domestic subtree. This is
generally a bad idea unless one knows precisely what they're doing,
but we'll provide the rope anyway (with the appropriate warnings).
Document both EXPORTABLE_SYSTEM and FORCE_DOMESTIC at the top of the file.
announced in a reasonable forum. Further, it adds significant overhead to
the build process, and doesn't work correctly when a non-root DESTDIR
build is attempted (unless texinfo is already available, which of course
makes this change unnecessary).
some programs like /usr/libexec/ftpd, need the kerberos etc libraries.
XXX: In reality programs like these should be moved to the domestic tree!
I would have assumed that if I make install in the exportable tree, I will
not install any domestic binaries!!!
the domestic tree if we are building an EXPORTABLE_SYSTEM.
Translate the conditional to English so as to avoid future problems
when people are tempted to modify it.
which has side effects, use _BUILD to determine whether we ought to
install things in the domestic subtree. Otherwise, the core idea from
the last revision is unchanged.
failed to account for how a 'make distribution' would get the proper bits
into the distribution tree. To correct this, we set EXPORTABLE_SYSTEM
while doing a 'make build' in order to avoid trying to install not-yet-
generated headers and binaries. I've also made the required adjustment
to the condition that adds "domestic" to SUBDIR.
This is too hairy and needs to die, but I don't see how it can until
we integrate the crypto bits into the main body of the tree.
obj, clean, cleandir and distclean. This reduces the chance of problems
(and the need to re-run make obj) if one is switching back and forth
between EXPORTABLE_SYSTEM and not, as US/Canadian developers tend to do.
parallel for a 'make build' (using make's -j flag). Only CPU-intensive jobs
are started in parallel.
Document the variables useable at the begining of the makefile
(NBUILDJOBS NOMAN NOSHARE UPDATE DESTDIR). Feel free to add documentation
for the ones I forgot !
Instead:
* If upgrading the compiler, build it *first*, before anything else.
* If upgrading the compiler and DESTDIR is set, barf.
This guarantees that libgcc is built during the library stage.