> From make's perspective there's little difference between a sub-make
> and any other command. Both are invoked in precisely the same way,
> and both get precisely the same environment.
Right. This is what needs explained in Commands -> Execution, along
with *what* will be in that environment; at present, all relevant
explanation is given in a section which *appears* to apply only to
recursive make.
> There is no 100% guaranteed way for make to tell whether any given
> command it's invoking is a sub-make, vs. any other kind of command like
> a compile.
This makes sense.
> ew> If the latter is really true, the section Commands -> Execution
> ew> should explain that each sub-shell is executed in an environment
> ew> which is augmented with every (sensibly-named) make variable set
> ew> in the invoking Makefile, exported as an environment variable;
> But that's not true, and I never said it was true (and neither does the
> documentation).
sorry, I mis-spoke: I should have said: `the section Commands ->
Execution should describe the environment in which each sub-shell is
executed'. It would also help if the discussion of recursive make (and
its environment) were careful to distinguish which bits only pertain to
recursive make and which apply to all sub-shells (with as much as
possible of the latter moving to the Commands -> Execution description).
> This behavior has been true of every make since the first one was
> written in the '70's, and I _think_ (although my copy is at work) that
> POSIX.2 requires it as well. I'll have to look it up tomorrow.
Sounds plausible.
> I will investigate whether there are other places this information
> would be better put.
Sounds a good plan ;^)
Sorry about the confusion along the way.
Eddy.