[coreboot-gerrit] New patch to review for coreboot: 9c92d85 Makefile: Avoid duplicate class suffixes in $(call src-to-obj)

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Tue Apr 21 10:09:32 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9861

-gerrit

commit 9c92d85ec09df8ce2896f2da4200e5fc799d1337
Author: Julius Werner <jwerner at chromium.org>
Date:   Thu Mar 12 23:17:16 2015 -0700

    Makefile: Avoid duplicate class suffixes in $(call src-to-obj)
    
    The build system uses the $(src-to-obj) function in multiple places to
    figure out the corresponding output object file for a certan source
    file, most importantly when generating the rule to build it. Usually
    this is pretty simple, but some odd cases are a little tricky... such as
    the auto-generated intermediary C files containing an array definition
    generated from an ASL file. These files have already been compiled per
    stage, so they contain the stage as a suffix and reside in the build
    directory (e.g. build/.../dsdt.ramstage.c).
    
    The previous $(src-to-obj) implementation just blindly appends the stage
    again and turns this into build/.../dsdt.ramstage.ramstage.o. This isn't
    very useful, so to avoid confusion this patch makes it strip additional
    stage suffixes for those intermediary files.
    
    This also fixes a bug with the ASL postprocessor, which didn't take this
    double suffix into account: it added build/.../dsdt.ramstage.o to
    ramstage-objs which should've been build/.../dsdt.ramstage.ramstage.o.
    This only worked by accident because make compiled the file with its
    implicit %.o: %.c rule instead.
    
    BRANCH=none
    BUG=chromium:466469
    TEST=emerge-falco coreboot with the new make 4.1. Also build Falco and
    Veyron_Jerry with make -r -R to make sure there are no other accidental
    uses of implicit rules in our build system.
    
    Change-Id: I4aeaa60add1ef4215cb6c0b222c3886395c7a045
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: d9ea2e082eca1045409ea1f403082c97dedc70d8
    Original-Change-Id: I951edbc9f653321a9084543a65009c6e9154d819
    Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/259950
    Original-Reviewed-by: Mike Frysinger <vapier at chromium.org>
    Original-Reviewed-by: Patrick Georgi <pgeorgi at chromium.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3c57608..e5255f8 100644
--- a/Makefile
+++ b/Makefile
@@ -209,7 +209,7 @@ $(foreach class,$(classes),$(eval $(class)-srcs:=$(sort $($(class)-srcs))))
 # Only .c and .S get converted to .o, other files (like .ld) keep their name.
 # $1 stage name
 # $2 file path (list)
-src-to-obj=$(foreach file,$(2),$(basename $(patsubst src/%,$(obj)/%,$(file))).$(1)$(patsubst %.c,%.o,$(patsubst %.S,%.o,$(suffix $(file)))))
+src-to-obj=$(foreach file,$(2),$(subst .$(1),,$(basename $(patsubst src/%,$(obj)/%,$(file)))).$(1)$(patsubst %.c,%.o,$(patsubst %.S,%.o,$(suffix $(file)))))
 
 $(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class),$($(class)-srcs))))
 



More information about the coreboot-gerrit mailing list