Wed 16 Mar 2005 07:32:55 AM UTC, comment #4:
Comments by Paul D.Smith in an email:
Hm. This solves the problem for .PHONY files, but what if you use the old-style FORCE target method to force rebuilds:
FORCE: ;
version.c: FORCE
This doesn't work with .SECONDARY set globally: it thinks FORCE doesn't need to be remade (even though it doesn't exist), so version.c doesn't need to be remade, etc.
Unfortunately it's not exactly clear from the documentation (which is all I have to go on) what it means to set .SECONDARY globally. If you take the documentation at face value, the current (3.81) behavior is correct and the bug you're reporting is actually an enhancement request, that marking a target as .PHONY take precedence over .SECONDARY and .INTERMEDIATE, whereas right now it's the other way around. Which is fine with me as a change, BTW.
However, I'm not sure that's really what the original intent of the global .SECONDARY target was... or else I'm not sure all the ramifications were completely thought out. Note you cannot define a global .INTERMEDIATE target! Why, then, can you define .SECONDARY globally, that imputes all the behavior of .INTERMEDIATE to all targets in the system--except for automatic deletion? It seems strange and unusual to me.
I have to wonder if the original point of the global .SECONDARY was really just to turn off all automatic deletions of any intermediate files, without really forcing every target to be considered intermediate. To me that would make more sense.
On the other hand, if you read the information provided with bug # 2515, which originally fostered this change, Bill Curry (the author of the bug) clearly feels that the former ("face value" reading) of the docs is correct and is what RMS intended when he introduced the feature, apparently at the request of the project that Bill is working on. So, I guess maybe that is correct. I personally would probably have implemented this differently, because it seems that we have a matrix of two different capabilities (delete/don't delete intermediates, and build/don't build non-existent files) and the current set of targets to set the capabilities doesn't cover the entire matrix: there are some things you can't do. I would have preferred to define the targets in a more orthogonal manner to cover the entire matrix. Then you could have used them in combination to get the behavior you wanted more precisely.
|