Attention is currently required from: Nicholas Chin, Nico Huber.
Hello Nico Huber, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/84387?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed: Code-Review+1 by Nico Huber, Verified+1 by build bot (Jenkins)
Change subject: Makefile.mk: Skip unnecessary recompiles when static.c/h are updated ......................................................................
Makefile.mk: Skip unnecessary recompiles when static.c/h are updated
The generated static.c file output by sconfig is currently added as a prerequisite for all objects to ensure that static.h exists before compiling anything that might need it. However, this forces every single object out of date when the compiled devicetree is updated, even though not every file actually needs static.h.
Only static.h actually needs to exist before compilation of other objects, since static.c is an independent compilation unit that doesn't need to exist before other objects can be built. Thus, change the prerequisite from static.c to static.h, and add a rule for static.h that depends on static.c. The recipe is a simple `true` since sconfig generates static.c and static.h at the same time. To prevent unnecessary recompiles, make static.h an order-only prerequisite [1] using the new generated files argument for create_cc_template to ensure that the header exists before any object might need it, but without forcing a recompile of all objects by default whenever it is updated.
On a clean build, all objects will be compiled since they do not exist, and these will occur after static.h is generated due to the default order-only prerequisite. On subsequent incremental compiles, sources that do need static.h will be appropriately marked out of date due to the generated .d dependency files from the compiler, which list static.h as a normal prerequisite for each objects that do include it, which overrides the default order-only prerequisite. The dependency files generated for all other objects will not include static.h, and thus the objects will not be updated since the default order-only dependency does not force them out of date.
After updating the devicetree of qemu-i440fx after a clean build, comparing the build log with `make --debug=why` with the generated dependency files indicates that only objects that actually depend on static.h were rebuilt, instead of every object. Running a timeless incremental build after making a change in the devicetree yielded identical roms when performed with this patch and main, with the only difference being the number of objects that needed to be rebuilt. Also tested with the E6430.
[1] https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html
Change-Id: I34efc162760ae703285f3982fa16cc23a86b37f6 Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M Makefile.mk 1 file changed, 11 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/84387/3