%% John Summerfield <[EMAIL PROTECTED]> writes:
js> This is particularly evident with a command such as this:
js> make -j4 clean all install
js> The problem is that the 'clean' target makes things that may be
js> built by 'all' vanish; if 'make clean' us still running when 'make
js> all' starts, make may get to the final stages (linking) and then
js> find some object files that were there now are not.
js> I argue that this is a reasonable way to use make; in general a
js> user should not need to know that making some targets makes others
js> vanish. I think make should cope with this, and that it would do
js> some with a slight loss of performance if it didn't start building
js> a new target until all previous targets are finished.
js> I think this logic MUST be applied to targets specified on the
js> commandline; I can imagine the same problem arising wrt targets
js> specified in Makefiles. but it may happen less often (but may be
js> more confusing as the person building the package would likely
js> know nothing about the Makefile contents...)
Uh... I don't understand. It sounds to me like you just don't want to
use -j!
When you say "it [doesn't] start building a new target until all
previous targets are finished", that's just a completely serial build.
That's very easy to do right now! ;)
_If_ you make the restriction that it only applies to commandline
targets, then you could still get some parallelism, but I believe that
would be more confusing than useful. Or, put another way, I'd rather
have make be consistent even if it doesn't work as the user expects,
than inconsistent so it works as the user expects sometimes but not
others.
The _real_ solution to problem you're trying to solve is not for make to
try to heuristically determine when the user wants parallel vs. serial
builds, but to add one or both of the following features, each of which
is important for different reasons and each of which would solve your
problem by itself:
1) Provide a way to force make to treat some specific targets serially.
This is needed for some types of targets which can't run in
parallel, such as incremental archives.
2) Provide a way to force target build order _without_ implying a
dependency relationship. That is, a way to say "you must build
clean before all" without having all rebuild whenever clean does,
and without having all try rebuild clean whenever it runs. This is
critical for many different situations once you throw parallelism
into the mix.
Currently make conflates order with dependency, which is usually
what you want but not always.
In my experience #2 would be useful in more situations, but I think #1
would probably be simpler to implement.
At any rate, both of these things are TODO list items.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.ultranet.com/~pauld/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist