Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1673327 > unrolled thread

[PATCH] kbuild: improve comments on KBUILD_SRC

Started byCao jin <caoj.fnst@cn.fujitsu.com>
First post2017-06-23 09:30 +0200
Last post2017-06-30 04:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] kbuild: improve comments on KBUILD_SRC Cao jin <caoj.fnst@cn.fujitsu.com> - 2017-06-23 09:30 +0200
    Re: [PATCH] kbuild: improve comments on KBUILD_SRC Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-06-29 17:20 +0200
      Re: [PATCH] kbuild: improve comments on KBUILD_SRC Cao jin <caoj.fnst@cn.fujitsu.com> - 2017-06-30 04:30 +0200

#1673327 — [PATCH] kbuild: improve comments on KBUILD_SRC

FromCao jin <caoj.fnst@cn.fujitsu.com>
Date2017-06-23 09:30 +0200
Subject[PATCH] kbuild: improve comments on KBUILD_SRC
Message-ID<tVrcv-7CL-19@gated-at.bofh.it>
Original comments is confusing on "OBJ directory", make it clear.

Bonus: move comments close to what it want to comment.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 57df756..81c0df9 100644
--- a/Makefile
+++ b/Makefile
@@ -113,8 +113,9 @@ export quiet Q KBUILD_VERBOSE
 # The O= assignment takes precedence over the KBUILD_OUTPUT environment
 # variable.
 
-# KBUILD_SRC is set on invocation of make in OBJ directory
-# KBUILD_SRC is not intended to be used by the regular user (for now)
+# KBUILD_SRC is not intended to be used by the regular user (for now),
+# it is set on invocation of make in KBUILD_OUTPUT directory, i.e., it
+# is set on using "make O=dir/to/store/output/files/"
 ifeq ($(KBUILD_SRC),)
 
 # OK, Make called in directory where kernel src resides
@@ -135,7 +136,6 @@ ifneq ($(words $(subst :, ,$(CURDIR))), 1)
 endif
 
 ifneq ($(KBUILD_OUTPUT),)
-# Invoke a second make in the output directory, passing relevant variables
 # check that the output directory actually exists
 saved-output := $(KBUILD_OUTPUT)
 KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
@@ -148,6 +148,7 @@ PHONY += $(MAKECMDGOALS) sub-make
 $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
 	@:
 
+# Invoke a second make in the output directory, passing relevant variables
 sub-make:
 	$(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
 	-f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
-- 
2.1.0

[toc] | [next] | [standalone]


#1677857

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2017-06-29 17:20 +0200
Message-ID<tXJoC-LR-11@gated-at.bofh.it>
In reply to#1673327
2017-06-23 16:31 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
> Original comments is confusing on "OBJ directory", make it clear.
>
> Bonus: move comments close to what it want to comment.
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>  Makefile | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 57df756..81c0df9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -113,8 +113,9 @@ export quiet Q KBUILD_VERBOSE
>  # The O= assignment takes precedence over the KBUILD_OUTPUT environment
>  # variable.
>
> -# KBUILD_SRC is set on invocation of make in OBJ directory
> -# KBUILD_SRC is not intended to be used by the regular user (for now)
> +# KBUILD_SRC is not intended to be used by the regular user (for now),
> +# it is set on invocation of make in KBUILD_OUTPUT directory, i.e., it
> +# is set on using "make O=dir/to/store/output/files/"

O= is not only the way to specify the output directory.

KBUILD_OUTPUT is used not only for an internal variable
but also for user interface to specify the output directory
(via environments).


How about something like this?

# KBUILD_SRC is not intended to be used by the regular user (for now),
# it is set on invocation of make with KBUILD_OUTPUT or O= specified.



-- 
Best Regards
Masahiro Yamada

[toc] | [prev] | [next] | [standalone]


#1678407

FromCao jin <caoj.fnst@cn.fujitsu.com>
Date2017-06-30 04:30 +0200
Message-ID<tXTR0-7Ni-15@gated-at.bofh.it>
In reply to#1677857

On 06/29/2017 11:14 PM, Masahiro Yamada wrote:
> 2017-06-23 16:31 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
>> Original comments is confusing on "OBJ directory", make it clear.
>>
>> Bonus: move comments close to what it want to comment.
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>> ---
>>  Makefile | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 57df756..81c0df9 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -113,8 +113,9 @@ export quiet Q KBUILD_VERBOSE
>>  # The O= assignment takes precedence over the KBUILD_OUTPUT environment
>>  # variable.
>>
>> -# KBUILD_SRC is set on invocation of make in OBJ directory
>> -# KBUILD_SRC is not intended to be used by the regular user (for now)
>> +# KBUILD_SRC is not intended to be used by the regular user (for now),
>> +# it is set on invocation of make in KBUILD_OUTPUT directory, i.e., it
>> +# is set on using "make O=dir/to/store/output/files/"
> 
> O= is not only the way to specify the output directory.
> 
> KBUILD_OUTPUT is used not only for an internal variable
> but also for user interface to specify the output directory
> (via environments).
> 
> 
> How about something like this?
> 
> # KBUILD_SRC is not intended to be used by the regular user (for now),
> # it is set on invocation of make with KBUILD_OUTPUT or O= specified.
> 

Accurate and much better. Thanks a lot. v2 is on the way.

-- 
Sincerely,
Cao jin

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web