From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Fri, 23 Sep 2011 09:22:22 -0700 Subject: [U-Boot] [RFC PATCH v2 20/20] sandbox: Makefile changes to build sandbox architecture In-Reply-To: <1316794942-24709-1-git-send-email-sjg@chromium.org> References: <1316794942-24709-1-git-send-email-sjg@chromium.org> Message-ID: <1316794942-24709-21-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de At this point U-Boot will build and run on x86 under Linux. The idea is to define a new architecture called 'sandbox', alongside ARM and x86. This runs natively on Linux to suit the host machine. All hardware access is either omitted or emulated. The purpose of this system is to test the bulk of the non-hardware-specific U-Boot code. We can mock the SPI flash, GPIOs, UART and keyboard, then test that U-Boot behaves as we wish. Signed-off-by: Simon Glass --- Changes in v2: - Rebase to master - Tidy top-level Makefile to minimise changes Makefile | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 672b5cd..47f6103 100644 --- a/Makefile +++ b/Makefile @@ -199,8 +199,9 @@ endif ######################################################################### # U-Boot objects....order is important (i.e. start must be first) - +ifneq ($(CPU),sandbox) OBJS = $(CPUDIR)/start.o +endif ifeq ($(CPU),x86) OBJS += $(CPUDIR)/start16.o OBJS += $(CPUDIR)/resetvec.o @@ -401,12 +402,19 @@ $(obj)u-boot.ubl: $(obj)u-boot-nand.bin $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +ifeq ($(CONFIG_SANDBOX),y) +GEN_UBOOT = \ + cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \ + -Wl,--start-group $(__LIBS) -Wl,--end-group \ + $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot +else GEN_UBOOT = \ - UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ - sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ + UNDEF_SYM=`$(UNDEF)`; \ cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot +endif + $(obj)u-boot: depend \ $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds $(GEN_UBOOT) -- 1.7.3.1