diff mbox series

[U-Boot,07/21] sandbox: Use 'extras' to specify 'head' files

Message ID 20181124042944.239106-8-sjg@chromium.org
State Accepted
Commit 40e9ede1dcd852a97d772b8d592e36195c5d8b80
Delegated to: Simon Glass
Headers show
Series Various patches for verified boot support | expand

Commit Message

Simon Glass Nov. 24, 2018, 4:29 a.m. UTC
At present sandbox has a start.o in the 'start' target but also includes
it in the normal target list. This is not how this is normally handled. It
is needed because sandbox does not include the u-boot-init variable in its
link rule.

Update the rule and move start.o from the normal target list to the
'extras' list.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/sandbox/Makefile     | 4 ++--
 arch/sandbox/config.mk    | 3 ++-
 arch/sandbox/cpu/Makefile | 5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

Comments

Simon Glass Dec. 5, 2018, 11:10 p.m. UTC | #1
At present sandbox has a start.o in the 'start' target but also includes
it in the normal target list. This is not how this is normally handled. It
is needed because sandbox does not include the u-boot-init variable in its
link rule.

Update the rule and move start.o from the normal target list to the
'extras' list.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/sandbox/Makefile     | 4 ++--
 arch/sandbox/config.mk    | 3 ++-
 arch/sandbox/cpu/Makefile | 5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

Applied to u-boot-dm/master, thanks!
diff mbox series

Patch

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 261079441cf..f6cf859f249 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -1,6 +1,6 @@ 
 # SPDX-License-Identifier: GPL-2.0+
 
-head-y := arch/sandbox/cpu/start.o
-
+head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
+head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
 libs-y += arch/sandbox/cpu/
 libs-y += arch/sandbox/lib/
diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index 95f9e3ff63f..7226b7be428 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -17,11 +17,12 @@  PLATFORM_CPPFLAGS += $(shell sdl-config --cflags)
 endif
 endif
 
-cmd_u-boot__ = $(CC) -o $@ -Wl,-T u-boot.lds \
+cmd_u-boot__ = $(CC) -o $@ -Wl,-T u-boot.lds $(u-boot-init) \
 	-Wl,--start-group $(u-boot-main) -Wl,--end-group \
 	$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
 
 cmd_u-boot-spl = (cd $(obj) && $(CC) -o $(SPL_BIN) -Wl,-T u-boot-spl.lds \
+	$(patsubst $(obj)/%,%,$(u-boot-spl-init)) \
 	-Wl,--start-group $(patsubst $(obj)/%,%,$(u-boot-spl-main)) \
 	$(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) -Wl,--end-group \
 	$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot-spl.map -Wl,--gc-sections)
diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index 8fe681844d9..bac96447d51 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -5,10 +5,11 @@ 
 # (C) Copyright 2000-2003
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
-obj-y	:= cpu.o os.o start.o state.o
+obj-y	:= cpu.o state.o
+extra-y	:= start.o os.o
+extra-$(CONFIG_SANDBOX_SDL)	+= sdl.o
 obj-$(CONFIG_SPL_BUILD)	+= spl.o
 obj-$(CONFIG_ETH_SANDBOX_RAW)	+= eth-raw-os.o
-obj-$(CONFIG_SANDBOX_SDL)	+= sdl.o
 
 # os.c is build in the system environment, so needs standard includes
 # CFLAGS_REMOVE_os.o cannot be used to drop header include path