summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/Makefile.inc b/Makefile.inc
index 0e34577683..f5cc207014 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