diff mbox

[U-Boot,4/4] kbuild: use relative path more to include Makefile

Message ID 1436029017-3278-5-git-send-email-yamada.masahiro@socionext.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada July 4, 2015, 4:56 p.m. UTC
Prior to this commit, it was impossible to use relative path to
include Makefiles from the top level Makefile because the option
"--include-dir=$(srctree)" becomes effective when Make enters into
sub Makefiles.

To use relative path in any places, this commit moves the option
above the "sub-make" target.

This was imported from Linux (commit a436bb7b8063) and adjusted for
U-Boot.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---

 Makefile | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

Comments

Tom Rini July 28, 2015, 2:58 p.m. UTC | #1
On Sun, Jul 05, 2015 at 01:56:57AM +0900, Masahiro Yamada wrote:

> Prior to this commit, it was impossible to use relative path to
> include Makefiles from the top level Makefile because the option
> "--include-dir=$(srctree)" becomes effective when Make enters into
> sub Makefiles.
> 
> To use relative path in any places, this commit moves the option
> above the "sub-make" target.
> 
> This was imported from Linux (commit a436bb7b8063) and adjusted for
> U-Boot.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Michal Marek <mmarek@suse.cz>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 865c25d..7471a4f 100644
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,10 @@  NAME =
 # Comments in this file are targeted only to the developer, do not
 # expect to learn how to build the kernel reading this file.
 
-# Do not use make's built-in rules and variables
-# (this increases performance and avoids hard-to-debug behaviour);
-MAKEFLAGS += -rR
+# o Do not use make's built-in rules and variables
+#   (this increases performance and avoids hard-to-debug behaviour);
+# o Look for make include files relative to root of kernel src
+MAKEFLAGS += -rR --include-dir=$(CURDIR)
 
 # Avoid funny character set dependencies
 unexport LC_ALL
@@ -319,12 +320,9 @@  endif
 export KBUILD_MODULES KBUILD_BUILTIN
 export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
 
-# Look for make include files relative to root of kernel src
-MAKEFLAGS += --include-dir=$(srctree)
-
 # We need some generic definitions (do not try to remake the file).
-$(srctree)/scripts/Kbuild.include: ;
-include $(srctree)/scripts/Kbuild.include
+scripts/Kbuild.include: ;
+include scripts/Kbuild.include
 
 # Make variables (CC, etc...)
 
@@ -518,8 +516,8 @@  ifneq ($(wildcard include/config/auto.conf),)
 autoconf_is_old := $(shell find . -path ./$(KCONFIG_CONFIG) -newer \
 						include/config/auto.conf)
 ifeq ($(autoconf_is_old),)
-include $(srctree)/config.mk
-include $(srctree)/arch/$(ARCH)/Makefile
+include config.mk
+include arch/$(ARCH)/Makefile
 endif
 endif
 endif
@@ -594,7 +592,7 @@  endif
 
 export CONFIG_SYS_TEXT_BASE
 
-include $(srctree)/scripts/Makefile.extrawarn
+include scripts/Makefile.extrawarn
 
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
 KBUILD_CPPFLAGS += $(KCPPFLAGS)