Follow-up Comment #1, bug #66500 (group make):

There is this makefile in the attachment.


baz: foo/tar
    touch baz
foo/tar: foo
foo: bar
    -mkdir foo
    touch foo/tar


Make is correct. Make is doing what this makefile tells make to do.
The user touches bar and runs make.  Make goes through the graph of targets
and rebuilds the targets that need to be rebuild. The graph is baz -> foo/tar
-> foo -> bar.  Make detects that bar changes and runs the recipe to rebuild
foo.  The recipe runs mkdir foo, mkdir foo fails, the recipe touches foo/tar.
After the recipe is done, foo is intact.  The mtime of a directory does not
change when the mtime of a file inside that directory changes.  Since foo is
intact, there is no need to rebuild foo/tar and no need to rebuild baz. Make
has no idea that the recipe touched foo/tar. The user runs make again.  Make
goes through the graph of targets and rebuilds the targets that need to be
rebuild. The graph is the same baz -> foo/tar -> foo -> bar.  Make detects
that foo/tar changed and touches baz.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66500>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to