summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChe-liang Chiou <clchiou@chromium.org>2011-10-17 21:04:15 +0000
committerWolfgang Denk <wd@denx.de>2011-10-22 00:40:06 +0200
commit349e83f071e2bf7bd9fec50377bbdcfb1a143666 (patch)
tree147c344fcac3fd84c04eab2156b5fce863663d68 /Makefile
parentdf6a36fbef32cd7f27b9ce7da22ad16d0b4ed62c (diff)
downloadu-boot-imx-349e83f071e2bf7bd9fec50377bbdcfb1a143666.zip
u-boot-imx-349e83f071e2bf7bd9fec50377bbdcfb1a143666.tar.gz
u-boot-imx-349e83f071e2bf7bd9fec50377bbdcfb1a143666.tar.bz2
examples: api: allow build with private libgcc
The examples/api is not configured with USE_PRIVATE_LIBGCC. This makes building examples/api break on certain boards that do not/cannot use the public libgcc. Nevertheless, this patch has to also touch the top-level Makefile to fix this problem because the current top-level Makefile does not specify libgcc as a prerequisite of examples/api, and explicitly builds examples/api _before_ libgcc. For testing this patch, I added the following to configs/seaboard.h and ran demo.bin on a Seaboard. +#define CONFIG_API +#define CONFIG_SYS_MMC_MAX_DEVICE 2 +#define CONFIG_CMD_NET +#define CONFIG_NET_MULTI Signed-off-by: Che-Liang Chiou <clchiou@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 13 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 97ac1d6..7aba2dd 100644
--- a/Makefile
+++ b/Makefile
@@ -137,7 +137,14 @@ unexport CDPATH
# The "tools" are needed early, so put this first
# Don't include stuff already done in $(LIBS)
-SUBDIRS = tools
+# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
+# is "yes"), so compile examples after U-Boot is compiled.
+SUBDIR_TOOLS = tools
+SUBDIR_EXAMPLES = examples/standalone examples/api
+SUBDIRS = $(SUBDIR_TOOLS)
+ifndef CONFIG_SANDBOX
+SUBDIRS += $(SUBDIR_EXAMPLES)
+endif
.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
@@ -154,11 +161,6 @@ 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 ?=
@@ -355,7 +357,7 @@ ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
-all: $(ALL-y)
+all: $(ALL-y) $(SUBDIR_EXAMPLES)
$(obj)u-boot.hex: $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
@@ -418,7 +420,7 @@ GEN_UBOOT = \
endif
$(obj)u-boot: depend \
- $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
+ $(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
$(GEN_UBOOT)
ifeq ($(CONFIG_KALLSYMS),y)
smap=`$(call SYSTEM_MAP,u-boot) | \
@@ -431,7 +433,7 @@ endif
$(OBJS): depend
$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
-$(LIBS): depend $(SUBDIRS)
+$(LIBS): depend $(SUBDIR_TOOLS)
$(MAKE) -C $(dir $(subst $(obj),,$@))
$(LIBBOARD): depend $(LIBS)
@@ -440,6 +442,8 @@ $(LIBBOARD): depend $(LIBS)
$(SUBDIRS): depend
$(MAKE) -C $@ all
+$(SUBDIR_EXAMPLES): $(obj)u-boot
+
$(LDSCRIPT): depend
$(MAKE) -C $(dir $@) $(notdir $@)