help-make
[Top][All Lists]
Advanced

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

Re: Does (normal) prerequisite order matter?


From: Matt England
Subject: Re: Does (normal) prerequisite order matter?
Date: Fri, 18 Nov 2005 15:45:35 -0600

(I'll try sending this again with the spam-inserted header text...)

Thanks Ken for the feedback.  A clarification:

At 11/18/2005 02:17 PM, Ken Smith wrote:
Consider this expansion of your example.

target1: prereq1 prereq2
        touch $@

prereq1:
        sleep 5
        touch $@

prereq2:
        touch $@

If you run gmake -j2, prereq2 will be created before prereq1.  If you
run gmake without parallelization, prereq1 will be created before
prereq2.  However, you can employ an order-only prerequisite to ensure
that prereq1 is completed before prereq2 begins even for parallel builds
by adding the following to the above expanded example.

prereq2: | prereq1


Does the following work to support parallel builds (without above the sleep's and touch's):

<Makefile>
target1: prereq1 prereq2

prereq2: | prereq1
</Makefile

?

-Matt






reply via email to

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