Apache OpenOffice (AOO) Bugzilla – Issue 34746
dmake doesn't set internal timestamp of phony targets to now
Last modified: 2013-08-07 15:34:52 UTC
if a target marked as .PHONY has own prerequisites, on building the internal timestamp of this target is set to the timestamp of its prerequisite instead of now. this prevents rebuild of any depending target.
Created attachment 17982 [details] see target "ooo" in sample makefile
Works as designed. You read the comment before you chased me through the source, did you? ;) It's coded exactly as your example suggests, but there must be a thinko somewhere. The following patch fixes your example. IMHO this is the correct fix, .PHONY doesn't require that a file has been created/updated, therefore always assume the current time. (Note that this can give funny effects on FAT32.) (Alternatively one could touch the file if there is one and use that time.) +++ dmake/sysintf.c 28 Sep 2004 20:24:04 -0000 @@ -710,12 +710,12 @@ /* Compute phony time as either the current time, or the most recent time * from the list of prerequisites if there are any. */ - if ( cp->ce_prq != NIL(LINK) ) { + /* if ( cp->ce_prq != NIL(LINK) ) { for(dp=cp->ce_prq; dp; dp=dp->cl_next) if ( dp->cl_prq->ce_time > phonytime ) phonytime = dp->cl_prq->ce_time; } - else + else */ phonytime = Do_time(); for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
>Works as designed. You read the comment before you chased >me through the source, did you? ;) sorry, no i didn't. i couldn't imagine that this behaviour is intended. any idea what might be the pupose of this? in real life it just causes the dependency chain to break...
I think this is a bug and we should fix it. The docu says: -- dmake man -- .PHONY Any target with this attribute set will have its recipe executed each time the target is made even if a file match- ing the target name can be located. Any targets that have a .PHONY attributed target as a prerequisite will be made each time the .PHONY attributed prerequisite is made. -- dmake man -- So IMHO a phony target should be handled like a normal target with the following two exceptions: 1. Allways build the target 2. Ignore the timestamp even if a file exists and assume it was just created/updated/touched. No special rules for prerequisite timestamps. I'm going to create a dmake43 cws and this might be a candidate for that cws.
Created attachment 18215 [details] Patch for dmake
I committed the previous patch.
Please verify.
works as preferred :-)
.