[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #60595] make doesn't always restart when a makefile is rebuilt
From: |
André Chalella |
Subject: |
[bug #60595] make doesn't always restart when a makefile is rebuilt |
Date: |
Sun, 23 May 2021 02:24:13 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 |
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/