Subject: toolchain/14980: bsd.subdir.mk .WAIT logic has no dependency handling
To: None <firstname.lastname@example.org>
From: None <email@example.com>
Date: 12/17/2001 14:52:26
>Synopsis: bsd.subdir.mk .WAIT logic has no dependency handling
>Arrival-Date: Mon Dec 17 11:54:00 PST 2001
>Originator: Todd Vierling
>Release: NetBSD 1.5.x, NetBSD-current 20011217
duh.org: Pointing out the obvious since 1994.
When the .WAIT logic for <bsd.subdir.mk> was added, no provision for any
kind of dependency handling was given. As a result, you cannot build
a single program that has multiple components, as so:
$ cd src/usr.sbin/dhcp
$ make all-client
In the past, you were able to do just the above, because the recursive
Makefiles would contain lines such as:
all-client: all-common all-minires ...
Since there's now 3 recursive targets that would need this handling (depend,
all, and dependall), this is a little more tricky. However, this SHOULD
be supported again, as building an individual component gets even more
difficult when the dependencies on in-tree libraries are not known for certain
to the builder.
This also has a big impact on parallelism: it's possible to add much more
recursion to parallel builds if the dependencies on the build order are
known at subdirectory recursion time.
I've had this on my personal to-do list for a long time, but never got
to making a sane scheme for doing these dependencies. My personal
suggestion would be to provide an extension to the contents of SUBDIR, as
SUBDIR= common1 common2:common1 common3 prog1:common2:common3 \
The result of this should be dependency rules to the effect of:
all-prog1: all-common2 all-common3
depend-prog1: depend-common2 depend-common3
dependall-prog1: dependall-common2 dependall-common3
The builder could then run "make dependall-prog2", for instance, and get
common1 autobuilt (but not common2 and common3). Note the complete lack
of .WAIT directives; there's *no* need for .WAIT to exist in SUBDIR when
using this scheme.
This scheme is trivial to implement within the <bsd.subdir.mk> .for loop,
but needs peer review before implementation....