diff options
author | Benjamin Walsh <benjamin.walsh@windriver.com> | 2016-08-15 17:24:28 -0400 |
---|---|---|
committer | Benjamin Walsh <benjamin.walsh@windriver.com> | 2016-09-15 09:42:24 -0400 |
commit | ec89a10c7e4d1a4b36e1934cb93e8625a4882a65 (patch) | |
tree | 23dd545aace03baa0bec1a0f5470e08087e5e263 /Makefile | |
parent | 5306a001906d34c0dd8313a6c5d9a75ca3c7a08b (diff) |
build: allow specifying a custom linker script relative to project
Build system will first check if the linker script is found relative to
the project directory, and if not, it will consider it to be an absolute
path, as before.
Change-Id: Idfc7e55febbc8c197643ca514dc01c3e2262712a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -702,7 +702,10 @@ LDFLAGS_zephyr += $(call cc-ldoption,$(LINKFLAGPREFIX)--build-id=none) LD_TOOLCHAIN ?= -D__GCC_LINKER_CMD__ ifdef CONFIG_HAVE_CUSTOM_LINKER_SCRIPT -KBUILD_LDS := $(subst $(DQUOTE),,$(CONFIG_CUSTOM_LINKER_SCRIPT)) +KBUILD_LDS := $(subst $(DQUOTE),,$(PROJECT_BASE)/$(CONFIG_CUSTOM_LINKER_SCRIPT)) +ifeq ($(wildcard $(KBUILD_LDS)),) +KBUILD_LDS := $(subst $(DQUOTE),,$(CONFIG_CUSTOM_LINKER_SCRIPT)) +endif else # Try a board specific linker file KBUILD_LDS := $(srctree)/boards/$(BOARD_NAME)/linker.ld |