Re: incremental bulds from scratch with beinstall.sh

From: Simon J. Gerraty <sjg_at_juniper.net>
Date: Tue, 06 May 2025 21:31:03 UTC
Nuno Teixeira <eduardo@FreeBSD.org> wrote:
> Other thing, I'm wandering how DIRDEPS will perform over METAMODE when

They are different things - tackle different issues.

DIRDEPS is all about build orchestration - which dirs get built and in
what order.  It can speed up the build by eliminating tree walks and
only building what is needed, but it also eliminates all the complexity
of src/Makefile* the build works the same whether you start at top-level
or in some leaf dir like usr.bin/bmake

META_MODE is all about [re]building the targets in a directory once
visited.  It doesn't matter weather you got there via a tree walk or
directly via DIRDEPS.

One exception to note is that if MK_DIRDEPS_BUILD==yes,
.MAKE.LEVEL 0 is reserved for build orchestration, no building is done.
If you just want to build the leaf dir you are in you need to use
-DNO_DIRDEPS or arrange for .MAKE.LEVEL=1 eg

MAKELEVEL=1 make -j8

> we do a buildworld/buildkernel with same src/obj on a new BE.

> First I will do the llvm tunning and one of these days I will try
> DIRDEPS and see how it goes. 

The FreeBSD tree lacks the per package makefiles that would allow
DIRDEPS to be automatically kept up to date, but you can approximate
using targets/pseudo/bootstrap-packages which will populate
targets/packages/* based on the PACKAGE settings in the various
makefiles under lib *bin etc.  Then 'make fetch' for example would build
whatever goes into the "fetch" package - but not the package itself as
again there's no dir/makefile to do that.

--sjg