help-make
[Top][All Lists]
Advanced

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

Re: looking for build order doc in parallel build


From: Yasushi SHOJI
Subject: Re: looking for build order doc in parallel build
Date: Thu, 19 Nov 2009 16:30:34 +0900
User-agent: Wanderlust/2.14.0

Hi Paul,

At Thu, 19 Nov 2009 01:17:43 -0500,
Paul Smith wrote:
[...]
> Then 1.fo finishes, so make kicks off 1.pdf.  Then 2.fo finishes, so
> make kicks off 2.pdf, and then 3.pdf.  Finally it builds "all".
> 
> You ask:
> 
> > so, what I am missing? is there implicit rule I have to take care?
> 
> But so far as I can see your makefile is fine and make is building
> everything just fine.  If there is a problem here, you haven't described
> what it is.  If you describe the behavior you're seeing that you don't
> like, we can help you figure out what you need to do in your makefile to
> fix it.

From what I have read, I thought that make will pick up what to work
on in depth-first order, regardless of parallelism. If that's true,
I'd assume, once 1.fo is done, make will pickup 1.pdf, instead of
N.fo.

here is another test case I've done.  I've put one sec sleep to
emulate slow .fo build. so that make can, if it wants, according to
depth-first order, pick up .pdf instead of .fo.

        all: $(addsuffix .pdf,1 2 3 4 5 6 7 8 9 0)
                @echo Making $@
        
        %.pdf: %.fo
                touch $@
        
        %.fo:
                @sleep 1
                touch $@

but the result is:

        $ make -j2
        touch 1.fo
        touch 2.fo
        touch 3.fo
        touch 4.fo
        touch 5.fo
        touch 6.fo
        touch 7.fo
        touch 8.fo
        touch 0.fo
        touch 9.fo
        touch 1.pdf
        touch 2.pdf
        touch 3.pdf
        touch 4.pdf
        touch 5.pdf
        touch 6.pdf
        touch 7.pdf
        touch 8.pdf
        touch 9.pdf
        touch 0.pdf
        Making all
        rm 5.fo 6.fo 8.fo 9.fo 7.fo 0.fo 1.fo 2.fo 3.fo 4.fo

from the result above, I assume that make is not selecting the next
work every time a forked sub process finish working (because that'd be
too expensive?), but decide the work order _before_ the first job
starts, no?

would you mind to enlighten me, if time permits, how it selects the
next work?  a pointer to make source code would be very much
appreciated.

thanks for you time and kind reply,
-- 
          yashi




reply via email to

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