]> git.sur5r.net Git - u-boot/commitdiff
kbuild: use $(KBUILD_SRC) to check out-of-tree build
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Tue, 11 Mar 2014 02:05:18 +0000 (11:05 +0900)
committerTom Rini <trini@ti.com>
Wed, 12 Mar 2014 21:04:54 +0000 (17:04 -0400)
Non-empty $(KBUILD_SRC) means out-of-tree build.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Makefile
mkconfig

index 8a1fe9bcaef572048dd9f356164ba6a242cd4ee0..1b1cfb85ed1c7833ddb7fa0bdb05d7bf3bfb1b75 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -556,11 +556,9 @@ export CONFIG_SYS_TEXT_BASE
 
 # Use UBOOTINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
-UBOOTINCLUDE    :=
-ifneq ($(OBJTREE),$(SRCTREE))
-UBOOTINCLUDE   += -I$(OBJTREE)/include
-endif
-UBOOTINCLUDE   += -I$(srctree)/include \
+UBOOTINCLUDE    := \
+               -Iinclude \
+               $(if $(KBUILD_SRC), -I$(srctree)/include) \
                -I$(srctree)/arch/$(ARCH)/include
 
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
index 9827e4deb4dcbc6a59622211ef55687c611e07de..b755d2ac699bb504024f0e510eae74fd5f152bfb 100755 (executable)
--- a/mkconfig
+++ b/mkconfig
@@ -103,7 +103,7 @@ fi
 #
 # Create link to architecture specific headers
 #
-if [ "$SRCTREE" != "$OBJTREE" ] ; then
+if [ -n "$KBUILD_SRC" ] ; then
        mkdir -p ${OBJTREE}/include
        LNPREFIX=${SRCTREE}/arch/${arch}/include/asm/
        cd ${OBJTREE}/include
@@ -125,7 +125,7 @@ if [ "${arch}" = "arm" ] ; then
        ln -s ${LNPREFIX}proc-armv asm/proc
 fi
 
-if [ "$SRCTREE" = "$OBJTREE" ] ; then
+if [ -z "$KBUILD_SRC" ] ; then
        cd ${SRCTREE}/include
 fi