linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] kbuild: add --include-dir flag only for out-of-tree build
@ 2018-09-14  6:33 Masahiro Yamada
  2018-09-30 13:46 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2018-09-14  6:33 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

The --include-dir flag is used to include check-in Makefiles from
$(objtree) without $(srctree)/ prefix.  Obviously, this is unneeded
for in-tree build.  Add the flag just before changing the working
directory.

This becomes effective after invoking sub-make.  Add a little bit
comments about it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v2:
  - Add some more comments

 Makefile | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index f8c8e12..233b57d 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,9 @@ NAME = Merciless Moray
 PHONY := _all
 _all:
 
-# 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)
+# Do not use make's built-in rules and variables
+# (this increases performance and avoids hard-to-debug behaviour)
+MAKEFLAGS += -rR
 
 # Avoid funny character set dependencies
 unexport LC_ALL
@@ -136,6 +135,13 @@ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
 $(if $(KBUILD_OUTPUT),, \
      $(error failed to create output directory "$(saved-output)"))
 
+# Look for make include files relative to root of kernel src
+#
+# This does not become effective immediately because MAKEFLAGS is re-parsed
+# once after the Makefile is read.  It is OK since we are going to invoke
+# 'sub-make' below.
+MAKEFLAGS += --include-dir=$(CURDIR)
+
 PHONY += $(MAKECMDGOALS) sub-make
 
 $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] kbuild: add --include-dir flag only for out-of-tree build
  2018-09-14  6:33 [PATCH v2] kbuild: add --include-dir flag only for out-of-tree build Masahiro Yamada
@ 2018-09-30 13:46 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2018-09-30 13:46 UTC (permalink / raw)
  To: Linux Kbuild mailing list; +Cc: Michal Marek, Linux Kernel Mailing List

2018年9月14日(金) 15:33 Masahiro Yamada <yamada.masahiro@socionext.com>:
>
> The --include-dir flag is used to include check-in Makefiles from
> $(objtree) without $(srctree)/ prefix.  Obviously, this is unneeded
> for in-tree build.  Add the flag just before changing the working
> directory.
>
> This becomes effective after invoking sub-make.  Add a little bit
> comments about it.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---


Applied to linux-kbuild.



> Changes in v2:
>   - Add some more comments
>
>  Makefile | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f8c8e12..233b57d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -15,10 +15,9 @@ NAME = Merciless Moray
>  PHONY := _all
>  _all:
>
> -# 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)
> +# Do not use make's built-in rules and variables
> +# (this increases performance and avoids hard-to-debug behaviour)
> +MAKEFLAGS += -rR
>
>  # Avoid funny character set dependencies
>  unexport LC_ALL
> @@ -136,6 +135,13 @@ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
>  $(if $(KBUILD_OUTPUT),, \
>       $(error failed to create output directory "$(saved-output)"))
>
> +# Look for make include files relative to root of kernel src
> +#
> +# This does not become effective immediately because MAKEFLAGS is re-parsed
> +# once after the Makefile is read.  It is OK since we are going to invoke
> +# 'sub-make' below.
> +MAKEFLAGS += --include-dir=$(CURDIR)
> +
>  PHONY += $(MAKECMDGOALS) sub-make
>
>  $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
> --
> 2.7.4
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-30 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-14  6:33 [PATCH v2] kbuild: add --include-dir flag only for out-of-tree build Masahiro Yamada
2018-09-30 13:46 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).