summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-05-08 12:16:26 +0200
committerRichard Braun <rbraun@sceen.net>2018-05-08 12:16:26 +0200
commita06a044cb86860b84dc142b7c88eb87f81f6ff29 (patch)
treed3b423297cb8b2d6e7cd64dac56496ca30d25594
parentbe911e66c82a9daab21ac580bdac5efa98168758 (diff)
Makefile: fix out-of-tree builds
Fix the path of the linker script dependency file so that it's generated in the build tree.
-rw-r--r--Makefile10
1 files changed, 2 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 17de6951..2ea03300 100644
--- a/Makefile
+++ b/Makefile
@@ -73,16 +73,10 @@ define xbuild_compile
$(COMPILE) -MMD -MP -c -o $@ $<
endef
-# $(call xbuild_gen_linker_script_depfile,<linker_script>)
-define xbuild_gen_linker_script_depfile
-$(call xbuild_replace_source_suffix,d,$(1))
-endef
-
define xbuild_gen_linker_script
$(call xbuild_action,LDS,$@) \
$(CPP) $(XBUILD_CPPFLAGS) -MMD -MP \
- -MF $(call xbuild_gen_linker_script_depfile,$<) \
- -MT $@ -P -o $@ $<
+ -MF $@.d -MT $@ -P -o $@ $<
endef
# $(call xbuild_link,<objects>)
@@ -300,8 +294,8 @@ COMPILE := $(CC) $(XBUILD_CPPFLAGS) $(XBUILD_CFLAGS)
x15_SOURCES := $(x15_SOURCES-y)
x15_OBJDEPS := $(call xbuild_replace_source_suffix,d,$(x15_SOURCES))
x15_OBJECTS := $(call xbuild_replace_source_suffix,o,$(x15_SOURCES))
-x15_LDS_D := $(call xbuild_gen_linker_script_depfile,$(x15_LDS_S))
x15_LDS := $(basename $(x15_LDS_S))
+x15_LDS_D := $(x15_LDS).d
XBUILD_LDFLAGS += -Wl,--script=$(x15_LDS)