Attention is currently required from: Martin L Roth.
Hello Martin L Roth, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/84386?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed: Verified+1 by build bot (Jenkins)
Change subject: Makefile: Allow defining order-only prerequisites in create_cc_template ......................................................................
Makefile: Allow defining order-only prerequisites in create_cc_template
Generated files such as static.h are currently added as prerequisites for all compilation units to ensure that they exist and are up to date before anything that might need them is compiled. However, this has the side effect of forcing every compilation unit out of date when such files are regenerated, even if the object has no dependency on the generated file. GNU Make has order-only prerequisites [1] which are used to define prerequisites that must be updated before a given target, but which don't force the target out of date.
Add a new argument to create_cc_template, similar to the "additional dependencies" argument, which allows dependencies on such generated files for a specified object class and source suffix to be defined. This new functionality will be utilized in subsequent commits to fix up the dependencies on generated files.
Objects that do depend on generated headers will still be handled correctly due to the .d dependency files that are generated by the compiler during the build, which declare normal prerequisites to any headers an object directly or indirectly includes. As per the GNU Make documentation, normal prerequisites take precedence over order-only prerequisites, so the header dependencies declared in the .d files will override the order-only one declared through create_cc_template.
This does mean that a necessary rebuild of an object due to a generated file may be missed if the dependency file from the compiler is missing, but this is an unusual situation that is unlikely to occur during normal incremental builds.
[1] https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html
Change-Id: I50d87b3d9012967eefb197be12b2e0f096b0b67c Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M Makefile 1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/84386/2