Non-empty $(KBUILD_SRC) means out-of-tree build.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
# 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)
#
# 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
ln -s ${LNPREFIX}proc-armv asm/proc
fi
-if [ "$SRCTREE" = "$OBJTREE" ] ; then
+if [ -z "$KBUILD_SRC" ] ; then
cd ${SRCTREE}/include
fi