On Sun, 2010-09-12 at 11:16 +0430, ali hagigat wrote: > I have copied one line of the make manual: > ----------------------------------------------------------------------------- > "Occasionally, however, you have a situation where you want to impose > a specific ordering on the rules to be invoked without forcing the > target to be updated if one of those rules is executed. In that case, > you want to define order-only prerequisites. " > ------------------------------------------------------------------------------ > Now Lets take a look at the following example: > target1: | di1 > @echo "inside target1" > @touch target1 > di1: > @echo "inside di1" > > If target1 does not exist, even the order-only prerequisite, di1, will > force target1 to be updated!
No it won't. Yes, the target will be updated, but not because of the order-only prerequisite. It's because the target doesn't exist. This can be trivially proven, by removing the order-only prerequisite and observing that target1 is still rebuilt. Therefore it's clear that the existence of the order-only prereq is not the triggering factor. Note that the manual says "without _forcing_ the target to be update" (emphasis added). It doesn't say the target will not be updated. It says that it won't be updated due to the order-only prereq being newer. -- ------------------------------------------------------------------------------- Paul D. Smith <[email protected]> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
