summaryrefslogtreecommitdiff
path: root/src/lib/Makefile.inc
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2016-01-23 00:50:00 +0100
committerNico Huber <nico.h@gmx.de>2016-01-28 00:31:00 +0100
commit81b09f40087d1a00afe30e379d2e8460203b1c5c (patch)
treef4afa32a6823caffe26009bddc6f5bfc81aa8574 /src/lib/Makefile.inc
parent116d67323b78cad4b0ddd354fc154c4e4ac60225 (diff)
downloadcoreboot-81b09f40087d1a00afe30e379d2e8460203b1c5c.tar.xz
Makefile: Make full use of src-to-obj macro
There were several spots in the tree where the path to a per class object file was hardcoded. To make use of the src-to-obj macro for this, it had to be moved before the inclusion of subdirs. Which is fine, as it doesn't have dependencies beside $(obj). Tested by verifying that the resulting coreboot.rom files didn't change for all of Jenkins' abuild configurations. Change-Id: I2eb1beeb8ae55872edfd95f750d7d5a1cee474c4 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/13180 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/lib/Makefile.inc')
-rw-r--r--src/lib/Makefile.inc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 5e788c0589..7eb91082b3 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -167,11 +167,11 @@ ramstage-y += version.c
smm-y += version.c
verstage-y += version.c
-$(obj)/lib/version.bootblock.o : $(obj)/build.h
-$(obj)/lib/version.romstage.o : $(obj)/build.h
-$(obj)/lib/version.ramstage.o : $(obj)/build.h
-$(obj)/lib/version.smm.o : $(obj)/build.h
-$(obj)/lib/version.verstage.o : $(obj)/build.h
+$(call src-to-obj,bootblock,$(dir)/version.c) : $(obj)/build.h
+$(call src-to-obj,romstage,$(dir)/version.c) : $(obj)/build.h
+$(call src-to-obj,ramstage,$(dir)/version.c) : $(obj)/build.h
+$(call src-to-obj,smm,$(dir)/version.c) : $(obj)/build.h
+$(call src-to-obj,verstage,$(dir)/version.c) : $(obj)/build.h
romstage-y += bootmode.c
ramstage-y += bootmode.c
@@ -202,8 +202,8 @@ RMODULE_LDFLAGS := -z defs -Bsymbolic
# It will create the necessary Make rules to create a rmodule. The resulting
# rmdoule is named $(1).rmod
define rmodule_link
-$(strip $(1)): $(strip $(2)) $$(COMPILER_RT_rmodules_$(4)) $(obj)/lib/rmodule.rmodules_$(4).ld | $$(RMODTOOL)
- $$(LD_rmodules_$(4)) $$(LDFLAGS_rmodules_$(4)) $(RMODULE_LDFLAGS) -T $(obj)/lib/rmodule.rmodules_$(4).ld --defsym=__heap_size=$(strip $(3)) -o $$@ --whole-archive --start-group $(filter-out %.ld,$(2)) --end-group
+$(strip $(1)): $(strip $(2)) $$(COMPILER_RT_rmodules_$(4)) $(call src-to-obj,rmodules_$(4),src/lib/rmodule.ld) | $$(RMODTOOL)
+ $$(LD_rmodules_$(4)) $$(LDFLAGS_rmodules_$(4)) $(RMODULE_LDFLAGS) -T $(call src-to-obj,rmodules_$(4),src/lib/rmodule.ld) --defsym=__heap_size=$(strip $(3)) -o $$@ --whole-archive --start-group $(filter-out %.ld,$(2)) --end-group
$$(NM_rmodules_$(4)) -n $$@ > $$(basename $$@).map
endef