[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
command line ordering within a single rule when parallel building
From: |
Nick.Thompson |
Subject: |
command line ordering within a single rule when parallel building |
Date: |
Tue, 1 Jul 2008 11:41:25 +0200 |
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. Is it safe to turn on parallel building in this case or do we need to
rewrite our rules?
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
Thanks,
Ratbert.
- command line ordering within a single rule when parallel building,
Nick.Thompson <=