[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

possible solution for -Otarget recurse (was: Re: Some serious issues wit

From: Paul Smith
Subject: possible solution for -Otarget recurse (was: Re: Some serious issues with the new -O option)
Date: Fri, 03 May 2013 12:55:26 -0400

I have a solution for this problem that I think will work well, and will
be simple to implement.

Suppose we do this: if we're about to invoke a line marked recursive and
we're in -Otarget mode, then before we run it we'll show the current
contents of the temp file (using the normal synchronized output

This will ensure that output from lines before the recursive make will
be shown before the targets in the recursive make.  It's not 100%
identical but I can't see any way to do better.


On Fri, 2013-05-03 at 16:39 +0300, Eli Zaretskii wrote:
> then how about if this exemption will only be applied if the recipe
> has a single command?

In this case, if a recipe consisted of only one line then every target
in the submake will be output immediately when it's finished, but as
soon as you add another line to the recipe, like "@echo "Build is
done!", now all of a sudden you get no output from the entire sub-make
until the end.  That would be too confusing.

> If the single-command-in-recursive-invocation is _not_ the use case
> which -Otarget is optimized for, then what use case is?

-Otarget is not really about recursive invocations at all.  It's there
for the non-recursive targets.  It would be nice if it worked well for
the recursive targets, too, obviously.

Consider every target in the entirety of build, including all submakes
and all their targets as well, as one long list of targets (for example
the results of a serial build).  The fraction of those targets that are
invoking sub-makes will be, at most, very small.

-Otarget wants to collect the output of each individual target, then
show the output for each target as soon as that target finishes.  That's
what users (should) expect when using this option.

In the case of recursive make targets, this presents an unsolveable
contradiction: how can you both show the output of EVERY target
(including the targets run by the submake) as soon as it completes, and
still not show the output of any target (including the targets that
invoke a submake) before it's complete?  You can't do both!

The -Omake option chooses the latter as more important: it will delay
the output until the submake is complete.

The -Otarget option chooses the former as more important: it wants to
behave properly for the large majority of targets which are not invoking
a recursive make.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]