help-make
[Top][All Lists]
Advanced

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

Re: Prerequisite ordering - make 3.81


From: Daniel Thom
Subject: Re: Prerequisite ordering - make 3.81
Date: Tue, 23 Jan 2007 09:54:53 -0800
User-agent: KMail/1.9.5

Thank you very much, that is what I thought.  This is was a very simplified 
example of what I really need to fix, which won't be quite as simple to 
repair.  It had been working for three years without changes, so before I 
went on rewriting the makerules that use this kind of broken logic I wanted 
to make absolutely sure.

        Regards,
        -dath

On Tuesday 23 January 2007 04:11, Dave Korn wrote:
> On 22 January 2007 15:09, Daniel Thom wrote:
> > As long as the 'target:' line with the "This operation is important. . ."
> > statement comes *BEFORE* 'target: two' the behavior is as shown above. 
> > If it is below 'target: two' both versions of make behave the same.
> >
> > Is this an expected difference between the two versions (I'm guessing it
> > is)? I did look at the info pages and google around, but I didn't see an
> > answer for this exact (and very simple) scenario.  I'm sure I can work
> > around this difference, though I need to support multiple versions of
> > make and would prefer not to kludge this too badly if this is a bug
> > rather than expected behavior (this is a much simplified example).
>
>   Make builds a tree (directed acyclic graph actually) of dependencies and
> walks it building prerequisites.  There has /never/ been /any/ guarantee
> about the order in which it walks the tree, and assuming that it will or
> won't visit nodes in any given order is an incorrect assumption.  This is
> one of the commonest causes of bugs that only appear when you use the -j
> option for parallel make, because when you do that your previous
> assumptions about order of building targets can go right out the window.
>
>   If you *require* target "two" to be built after target "one", then it is
> in fact the case that "one" is a /prerequisite/ of "two", and should be
> listed as such in your makefile; the fact you have omitted this dependency
> is a bug in your code.
>
>     cheers,
>       DaveK




reply via email to

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