bugmake - Bugs: bug #16958, Marking .PHONY dependencies as...


bug #16958: Marking .PHONY dependencies as targets is a regression against 3.80

Submitter:  None
Submitted:  Wed 28 Jun 2006 12:35:39 PM UTC
Severity:  3 - Normal Item Group:  Bug
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  3.81 Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup

Mon 31 Jul 2006 01:27:08 PM UTC, comment #5: 

Yes, the failing test case is case.2 in features/patternrules

%.2: void
@exit 1
%.2: 2.phony
@exit 0
.PHONY: 2.phony

David Kågedal <d_kagedal>
Wed 26 Jul 2006 08:16:39 AM UTC, comment #4: 

AFAICR, the change fixed some problems in pattern rules. As Paul suggested, you can revert the change and run the regression tests; I am sure some of them will fail. Also note that the change is conceptually correct - a file declared .PHONY effectively becomes a target since you can now 'make' it.

Boris Kolpackov <bosk>
Group Member
Tue 25 Jul 2006 03:28:44 PM UTC, comment #3: 

Hi David; have you tried reverting the change, then running the regression test suite?  Most of the time when we make a change we also introduce a test case to ensure it works properly (and will continue to do so).

If you revert the change and one or more tests fail, it might give you some insight as to why the change was made.

Paul D. Smith <psmith>
Group administrator
Mon 24 Jul 2006 09:34:33 AM UTC, comment #2: 

But you never explained why you made the change.  What problem did it solve? So far, the only difference in behaviour I have seen is the regression reported here.

(I was the original reporter, btw)

David Kågedal <d_kagedal>
Wed 28 Jun 2006 05:32:24 PM UTC, comment #1: 

Prerequisites of the .PHONY special target are marked as targets because they are effectively targets. For example, if you have an empty Makefile and say

$ make all

you get:

make: * No rule to make target `all'.  Stop.

If, however, you have this in your makefile

.PHONY: all

then there is no problem building all. Both 3.80 and 3.81 print

make: Nothing to be done for `all'.

I am not saying that we shouldn't fix this regression. I am saying that I believe the code I added is correct and the problem is elsewhere (most likely in the code that decides whether to use commands from .DEFAULT or not).

Boris Kolpackov <bosk>
Group Member
Wed 28 Jun 2006 12:35:39 PM UTC, original submission:  

Running "make foo" with a Makefile containing the following two rules produces different results with make 3.80 and 3.81.

.PHONY: foo

echo the target is $@

With 3.80, it prints "the target is foo", and with 3.81 it states that "Nothing to be done for `foo'".   This was caused by adding the following line to file.c in int .PHONY case (line 675).

          f2->is_target = 1;

This is a regression, since it breaks our makefiles, and I don't understand why phonies should be considered as explicit targets unless there are actual rules for them.

The ChangeLog mentions this, but it doesn't really explain why the change was made.

2004-09-21  Boris Kolpackov  <boris@kolpackov.net>

  • file.c (snap_deps): Mark .PHONY prerequisites as targets.

  • implicit.c (pattern_search): When considering an implicit rule's

prerequisite check that it is actually a target rather then
just an entry in the file hashtable.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #10263:  Makefile added by None (48B - application/octet-stream - The test Makefile)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.


Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2007-01-04 randyl Carbon-Copy- Added randyl
2006-07-24 d_kagedal Carbon-Copy- Added d_kagedal
2006-06-28 None Attached File- Added Makefile, #10263

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code