[PATCH 5/6] Makefile: tune the include order

Peng Fan (OSS) peng.fan at oss.nxp.com
Wed Mar 27 15:10:49 CET 2024


From: Peng Fan <peng.fan at nxp.com>

For OF_UPSTREAM support, the U-Boot headers under dt-bindings/ maybe
different with OF_UPSTREAM headers. So let OF_UPSTREAM headers be
included first when migrating to OF_UPSTREAM.

Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index b80924241ec..b9c2d896c2e 100644
--- a/Makefile
+++ b/Makefile
@@ -827,6 +827,7 @@ KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
 # Use UBOOTINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
 UBOOTINCLUDE    := \
+	-I$(srctree)/dts/upstream/include \
 	-Iinclude \
 	$(if $(KBUILD_SRC), -I$(srctree)/include) \
 	$(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
@@ -835,8 +836,7 @@ UBOOTINCLUDE    := \
 				-I$(srctree)/arch/arm/thumb1/include), \
 			-I$(srctree)/arch/arm/thumb1/include)) \
 	-I$(srctree)/arch/$(ARCH)/include \
-	-include $(srctree)/include/linux/kconfig.h \
-	-I$(srctree)/dts/upstream/include
+	-include $(srctree)/include/linux/kconfig.h
 
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
 
@@ -907,7 +907,7 @@ ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
 PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a
 else
 ifndef CONFIG_CC_IS_CLANG
-PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
+PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`)
 endif
 endif
 PLATFORM_LIBS += $(PLATFORM_LIBGCC)

-- 
2.35.3



More information about the U-Boot mailing list