[U-Boot] [PATCH v2] Makefile: do not create a symbolic link to arch/${ARCH}/include/asm

Masahiro Yamada yamada.m at jp.panasonic.com
Fri Nov 1 02:28:45 CET 2013


In-tree build:
  - Do not create a symbolic link
      from include/asm to arch/${ARCH}/include/asm
  - Add ${SRCTREE}/arch/arm/include into the header search path

Out-of-tree build:
  - Do not create a directory ${OBJTREE}/include2
  - Do not create a symbolic link
      from ${OBJTREE}/include2/asm to ${SRCTREE}/arch/${ARCH}/include/asm
  - Add ${SRCTREE}/arch/arm/include into the header search path

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
---
Changes in v2:
  - Rebase on u-boot/master

 config.mk           |  4 ++--
 mkconfig            | 14 ++++++--------
 tools/Makefile      |  2 +-
 tools/env/Makefile  |  2 +-
 tools/imls/Makefile |  2 +-
 5 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/config.mk b/config.mk
index 91a8f24..3441387 100644
--- a/config.mk
+++ b/config.mk
@@ -257,10 +257,10 @@ endif
 endif
 
 ifneq ($(OBJTREE),$(SRCTREE))
-CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
+CPPFLAGS += -I$(OBJTREE)/include
 endif
 
-CPPFLAGS += -I$(TOPDIR)/include
+CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
 CPPFLAGS += -fno-builtin -ffreestanding -nostdinc	\
 	-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
 
diff --git a/mkconfig b/mkconfig
index 1d06c8e..40db991 100755
--- a/mkconfig
+++ b/mkconfig
@@ -96,17 +96,11 @@ fi
 #
 if [ "$SRCTREE" != "$OBJTREE" ] ; then
 	mkdir -p ${OBJTREE}/include
-	mkdir -p ${OBJTREE}/include2
-	cd ${OBJTREE}/include2
-	rm -f asm
-	ln -s ${SRCTREE}/arch/${arch}/include/asm asm
 	LNPREFIX=${SRCTREE}/arch/${arch}/include/asm/
-	cd ../include
+	cd ${OBJTREE}/include
 	mkdir -p asm
 else
-	cd ./include
-	rm -f asm
-	ln -s ../arch/${arch}/include/asm asm
+	cd arch/${arch}/include
 fi
 
 rm -f asm/arch
@@ -122,6 +116,10 @@ if [ "${arch}" = "arm" ] ; then
 	ln -s ${LNPREFIX}proc-armv asm/proc
 fi
 
+if [ "$SRCTREE" = "$OBJTREE" ] ; then
+	cd ${SRCTREE}/include
+fi
+
 #
 # Create include file for Make
 #
diff --git a/tools/Makefile b/tools/Makefile
index ca76f94..14d94e3 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -160,7 +160,7 @@ NOPEDOBJS := $(addprefix $(obj),$(NOPED_OBJ_FILES-y))
 #
 HOSTCPPFLAGS =	-include $(SRCTREE)/include/libfdt_env.h \
 		-idirafter $(SRCTREE)/include \
-		-idirafter $(OBJTREE)/include2 \
+		-idirafter $(SRCTREE)/arch/$(ARCH)/include \
 		-idirafter $(OBJTREE)/include \
 		-I $(SRCTREE)/lib/libfdt \
 		-I $(SRCTREE)/tools \
diff --git a/tools/env/Makefile b/tools/env/Makefile
index 14d131b..27892f7 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -14,7 +14,7 @@ HEADERS	:= fw_env.h $(OBJTREE)/include/config.h
 
 # Compile for a hosted environment on the target
 HOSTCPPFLAGS  = -idirafter $(SRCTREE)/include \
-		-idirafter $(OBJTREE)/include2 \
+		-idirafter $(SRCTREE)/arch/$(ARCH)/include \
 		-idirafter $(OBJTREE)/include \
 		-idirafter $(SRCTREE)/tools/env \
 		-DUSE_HOSTCC \
diff --git a/tools/imls/Makefile b/tools/imls/Makefile
index e371983..b045df2 100644
--- a/tools/imls/Makefile
+++ b/tools/imls/Makefile
@@ -37,7 +37,7 @@ LIBFDT_OBJS	:= $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
 # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
 #
 HOSTCPPFLAGS  = -idirafter $(SRCTREE)/include \
-		-idirafter $(OBJTREE)/include2 \
+		-idirafter $(SRCTREE)/arch/$(ARCH)/include \
 		-idirafter $(OBJTREE)/include \
 		-I $(SRCTREE)/lib/libfdt \
 		-I $(SRCTREE)/tools \
-- 
1.8.3.2



More information about the U-Boot mailing list