From 711523958f620a9834c822f905c87ed892b32ec4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 17 Sep 2011 06:48:50 +0000 Subject: sandbox: Disable standalone/API support This is not useful on the sandbox architecture since we can simply link all our code with U-Boot. Signed-off-by: Simon Glass --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5db2e0e..44e3726 100644 --- a/Makefile +++ b/Makefile @@ -137,9 +137,7 @@ unexport CDPATH # The "tools" are needed early, so put this first # Don't include stuff already done in $(LIBS) -SUBDIRS = tools \ - examples/standalone \ - examples/api +SUBDIRS = tools .PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE) @@ -156,6 +154,11 @@ sinclude $(obj)include/autoconf.mk include $(obj)include/config.mk export ARCH CPU BOARD VENDOR SOC +ifndef CONFIG_SANDBOX +SUBDIRS += examples/standalone \ + examples/api +endif + # set default to nothing for native builds ifeq ($(HOSTARCH),$(ARCH)) CROSS_COMPILE ?= -- cgit v1.1 From 47508843061b8dd9455ec86df00d56b462f2a5c9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 7 Oct 2011 13:53:49 +0000 Subject: Adjust dependency rules to permit per-file flags The dependency rules are currently done in a shell 'for' loop. This does not permit Makefile variables to adjust preprocessor flags as is done with normal compile flags, using the CFLAGS_path/file.o syntax. This change moves the dependency generation into the Makefile itself, and permits a CPPFLAGS_path/file.o to adjust preprocessor flags on a file or directory basis. The CPPFLAGS_... variable is also folded into CFLAGS during the build. Signed-off-by: Simon Glass --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 44e3726..a0cafbd 100644 --- a/Makefile +++ b/Makefile @@ -955,7 +955,7 @@ clean: | xargs rm -f clobber: clean - @find $(OBJTREE) -type f \( -name '*.depend' \ + @find $(OBJTREE) -type f \( -name '*.depend*' \ -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \ -print0 \ | xargs -0 rm -f -- cgit v1.1 From 86eb49b3e596baa688bea5ef678e951e964845a3 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Oct 2011 19:26:50 +0000 Subject: sandbox: Makefile changes to build sandbox architecture 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 --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a0cafbd..1c49f30 100644 --- a/Makefile +++ b/Makefile @@ -403,12 +403,20 @@ $(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`;\ 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) -- cgit v1.1 From efb2172ece93ef48f34fb8bdf963d3b72880cc7d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 10 Oct 2011 08:55:19 +0000 Subject: Move timestamp and version files into 'generated' subdir There is a rather subtle build problem where the build time stamp is not updated for out-of-tree builds if there exists an in-tree build which has a valid timestamp file. So if you do an in-tree build, then an out-of-tree build your timestamp will not change. The correct timestamp_autogenerated.h lives in the object tree, but it is not always found there. The source still lives in the source tree and when compiling version.h, it includes timestamp_autogenerated.h. Since the current directory is always searched first, this will come from the source tree rather than the object tree if it exists there. This affects dependency generation also, which means that common/cmd_version.o will not even be rebuilt if you have ever done an in-tree build. A similar problem exists with the version file. This change moves both files into the 'generated' subdir, which is already used for asm-offsets.h. Then timestamp.h and version.h are updated to include the files from there. There are other places where these generated files are included, but I cannot see why these don't just use the timestamp.h and version.h headers. So this change also tidies that up. I have tested this with in- and out-of-tree builds, but not SPL. I have looked at various other options for fixing this, including sed on the dep files, -I- and -include flags to gcc, but I don't think they can be made to work. Comments welcome. Signed-off-by: Simon Glass Acked-by: Mike Frysinger --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1c49f30..e9a153c 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,8 @@ U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) else U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION) endif -TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h -VERSION_FILE = $(obj)include/version_autogenerated.h +TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h +VERSION_FILE = $(obj)include/generated/version_autogenerated.h HOSTARCH := $(shell uname -m | \ sed -e s/i.86/x86/ \ -- cgit v1.1