Follow-up Comment #2, bug #60595 (project make): I have attached an example Makefile (with comments) that illustrates my use case. It models a project where 'program1' uses 'module1' which in turn uses 'module2'.
Dependency resolution is managed through .d files, which in the real system are autogenerated from the real source files. The module*.d recipe creates a 'guard' file as side-effect, whose purpose is to signal to the program*.d recipe that it must wait the next restart to do real work. That is because the program*.d recipe needs the rules in module*.d correctly loaded in make. When make restarts, it removes the guard file. In the example, 'make' makes the fake program 'program1' correctly, while 'make wrong' triggers the buggy behavior. The only difference is the include order. I suggest following the sequence below: $ make $ touch program1.d && make $ touch module1.d && make $ touch module2.d && make You shall see make correctly updating and rebuilding only the needed files. However, run: $ touch module2.d && make wrong You will see that the build occurs before 'program1.d' is properly rebuilt, i.e make doesn't restart after updating 'module1.d', contrary to the manual. Run 'make wrong' again and you will see that only now 'program1.d' gets updated, but 'program1' has already been built, so it is too late. (file #51463) _______________________________________________________ Additional Item Attachment: File name: Makefile Size:1 KB <https://file.savannah.gnu.org/file/Makefile?file_id=51463> _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?60595> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/