bugmake - Bugs: bug #37708, File rules compare wrong own...


bug #37708: File rules compare wrong own timestamps

Submitted by:  None
Submitted on:  Sat 10 Nov 2012 06:18:16 PM UTC  
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sun 13 Jan 2013 08:19:32 PM UTC, comment #1:

This is not technically a bug... or if it is it's a duplicate of the directory cache issue. Your makefile is not being honest with make: as far as your makefile is concerned, there is no way for the file "depended_real_file" to ever be updated. Thus, make does some shortcuts to improve performance.

However, because your makefile really does change the time of "depended_real_file" behind make's back (as a hidden side-effect of updating "depended_remake_always"), things don't work well.

I suspect that what you want to do could be more straightforwardly done but there's not enough detail here to know for sure; if you want help please email -email is unavailable- rather than using the bug tracker.

If you change your makefile such that you give commands to the "depended_real_file" target, even if they're empty, then make will re-check the timestamp because it thinks maybe something changed; then your makefile will work (always rebuilds main):

Paul D. Smith <psmith>
Project Administrator
Sat 10 Nov 2012 06:18:16 PM UTC, original submission:

Have test makefile:

.PHONY: depended_remake_always

all : depended_remake_always main
depended_remake_always :
if [ \( ! -e ./depended_real_file \) -o \( ./depended -nt ./depended_real_file \) ]; then \
touch depended_real_file; \
echo depended_real_file remade; \
depended_real_file: depended_remake_always
main: depended_real_file
echo "about to do main"
touch main

in command line
touch depended
make -f test.mak main

doesn't proceed rule main while depended_remake_always made. It happens because timestamps of main and depended_real_file compared on wrong stage: namely BEFORE depended_real_file rule FULLY executes.

As workaround
touch depended
make -f test.mak all
works as it should



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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-01-13 psmith StatusNone => Not A Bug
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.3