help-make
[Top][All Lists]
Advanced

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

Re: command line ordering within a single rule when parallel building


From: Sam Ravnborg
Subject: Re: command line ordering within a single rule when parallel building
Date: Tue, 1 Jul 2008 13:03:34 +0200
User-agent: Mutt/1.4.2.1i

On Tue, Jul 01, 2008 at 11:41:25AM +0200, address@hidden wrote:
> Hi,
> 
> I have a basic question about command line execution when
> using -jN to build a target.
> How are the command lines of a single make rule scheduled
> for execution when running parallel builds? It seems clear
> that they will be started in the order given, but does make
> wait for one to complete before starting the next?
> (By wait, I expect it can, and will, get on with other rules'
> command lines in parallel, if possible.)

> We have command sequences within single rules which have to
> follow step wise (so are implicitly interdependent) and we 
> rely only on the ordering of the command lines within a rule 
> to ensure this. Of course we could use && constructs to 
> construct single command lines that the shell would then 
> sequence for us, but this is not how the majority of our 
> makefiles are written.

[Please type enter to break your looong lines - thanks]

> Is it safe to turn on parallel building in this case or do
> we need to rewrite our rules?

make will execute all commands for a single rule sequentially.

> 
> As an example, is the following safe in a parallel build
> when each command needs to be complete before the next is run?:
>

> target.x: input1.dat input2.dat
>         extract_data input1.dat >output.dat
>         extract_data input2.dat >>output.dat
>             target_create output.dat >target.x
>         rm output.dat

So this is safe to do.

        Sam




reply via email to

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