Subject: toolchain/14980: .WAIT logic has no dependency handling
To: None <>
From: None <>
List: netbsd-bugs
Date: 12/17/2001 14:52:26
>Number:         14980
>Category:       toolchain
>Synopsis: .WAIT logic has no dependency handling
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 17 11:54:00 PST 2001
>Originator:     Todd Vierling
>Release:        NetBSD 1.5.x, NetBSD-current 20011217
>Organization: Pointing out the obvious since 1994.

See "Release"


When the .WAIT logic for <> 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.

See "Description"


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-common2: all-common1
depend-common2: depend-common1
dependall-common2: dependall-common1

all-prog1: all-common2 all-common3
depend-prog1: depend-common2 depend-common3
dependall-prog1: dependall-common2 dependall-common3

all-prog2: all-common1
depend-prog2: depend-common1
dependall-prog2: dependall-common1

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 <> .for loop,
but needs peer review before implementation....