This follows on the footsteps of guenther@, who did a similar job in the
kernel.

Basically, the old-style "make depend, then make all" bsd makefile pattern
is GONE.

More accurately, dependencies are now generated on the fly using gcc and
clang's -M* options.

Instead of a "magical" .depend file, this results in *.d files that get
included through bsd.dep.mk.


The "make depend" stage is still present before "make all", but it's only
actually used by very few (<10) directories, and my goal is to eventually 
remove the need entirely.

(Yes, there are  more clean-up patches coming)

Complex internal dependencies are now most often handled thru a new 
BUILDFIRST/BUILDLATER mechanism.

Directories which need a separate configure stage (like perl) are handled
(or will be handled) thru two stage makefiles.

Benefits are four-folds:

- less complexity. You will no longer meet with errors if you forget to
"make depend" before you build something in a directory.
(once the <10 problematic directories are fixed)

- better cache behavior.  make depend could be really slow, as it needed to
more or less pull the whole source tree, dragging and kicking, through the
buffer cache, thus completely flooding it on small machines, and resulting
in slow performance. Now, the source tree is pulled more slowly in the cache,
and gets compiled and analysed for dependencies at the same time.

- better parallel behavior.  mkdep was inherently sequential, whereas most
directories have little inter-dependencies, so the compilation can run in
parallel.

- clang gains dependency analysis for free, without any need for 
the complicated patch I did a few weeks ago.


Thanks again to everybody who helped.

Reply via email to