From 990e7c90f035f0c9363e0c65100373795758a1da Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 3 Apr 2015 10:47:15 +0200 Subject: build system x86: deprecate bootblock_lds and ldscripts variables Instead of keeping this separate variable around, add linker scripts to the $(class)-y source lists and let the build system sort things out. This is inspired by the commit listed below, but rewritten to match upstream, and split in smaller pieces to keep intent clear. Change-Id: I4af687becf2971e009cb077debc902d2f0722cfb Signed-off-by: Patrick Georgi Based-On-Change-Id: I50af7dacf616e0f8ff4c43f4acc679089ad7022b Based-On-Signed-off-by: Julius Werner Based-On-Reviewed-on: https://chromium-review.googlesource.com/219170 Reviewed-on: http://review.coreboot.org/9289 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- Makefile.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Makefile.inc') diff --git a/Makefile.inc b/Makefile.inc index 0e3457768353..f5cc207014a6 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -113,8 +113,8 @@ files-in-dir=$(filter-out $(call dir-wildcards,$(call filter-out-dirs,$(1),$(sor # reduce command line length by linking the objects of each # directory into an intermediate file ramstage-postprocess=$(foreach d,$(sort $(dir $(1))), \ - $(eval $(d)ramstage.o: $(call files-in-dir,$(d),$(1)); $$(LD_ramstage) -o $$@ -r $$^ ) \ - $(eval ramstage-objs:=$(d)ramstage.o $(filter-out $(call files-in-dir,$(d),$(1)),$(ramstage-objs)))) + $(eval $(d)ramstage.o: $(call files-in-dir,$(d),$(filter-out %.ld,$(1))); $$(LD_ramstage) -o $$@ -r $$^ ) \ + $(eval ramstage-objs:=$(d)ramstage.o $(filter-out $(call files-in-dir,$(d),$(1)),$(filter-out %.ld,$(ramstage-objs))))) romstage-generic-ccopts += -D__PRE_RAM__ ifeq ($(CONFIG_TRACE),y) @@ -139,6 +139,15 @@ romstage-c-deps:=$$(OPTION_TABLE_H) verstage-c-deps:=$$(OPTION_TABLE_H) bootblock-c-deps:=$$(OPTION_TABLE_H) +# Add handler to copy linker scripts +define generic-objs_ld_template_gen +de$(EMPTY)fine $(1)-objs_ld_template +$$(call src-to-obj,$1,$$(1).ld): $$(1).ld + @printf " CP $$$$(subst $$$$(obj)/,,$$$$(@))\n" + cp $$$$< $$$$@ +en$(EMPTY)def +endef + # Add handler to add no rules for manual files define generic-objs_manual_template_gen # do nothing -- cgit v1.2.3