[Top][All Lists]

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

[bug #28983] forcing a target matching a pattern rule shadows the rule's

From: Paul D. Smith
Subject: [bug #28983] forcing a target matching a pattern rule shadows the rule's actions
Date: Fri, 02 Jul 2010 21:43:41 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100628 Ubuntu/10.04 (lucid) Firefox/3.6.6

Update of bug #28983 (project make):

                  Status:                    None => Not A Bug              
             Open/Closed:                    Open => Closed                 


Follow-up Comment #8:

A few things.  First, I cannot reproduce at all the behavior you show in your
original bug description, where sometimes using a pattern rule make will
rebuild file.o.  If you use a pattern rule, make should NEVER rebuild file.o
(if it's declared .PHONY) and that's exactly the behavior I see.  If you can
reproduce that behavior, that would indeed be a bug.  Please provide more
details in that case.

Second, the behavior difference you see is a direct consequence of one of the
primary purposes of the .PHONY feature, and is described clearly in the

   Since it knows that phony targets do not name actual files that
could be remade from other files, `make' skips the implicit rule search
for phony targets (*note Implicit Rules::).  This is why declaring a
target phony is good for performance, even if you are not worried about
the actual file existing.

So, in your examples with pattern rules, no pattern rule search is done and
thus _there is no recipe to build file.o_ so make doesn't build it.  This is
identical to the behavior you'd see if there were no pattern rule at all.  If
you define a target explicitly for file.o, then make will see that and try to
build it (every time, because it's marked PHONY).

Because this is behaving exactly as described in the manual I'm marking this
as "Not a Bug".  However, if you have an alternative behavior that you think
would make more sense please feel free to comment here; if you convince me
I'll be happy to reopen this and make it an enhancement request instead.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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