diff mbox

[v2] Kbuild: tiny correction on `make help`

Message ID 1496740073-3320-1-git-send-email-caoj.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cao jin June 6, 2017, 9:07 a.m. UTC
The help info of `make C=1` is little confusing, make it clear.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada June 6, 2017, 3:01 p.m. UTC | #1
2017-06-06 18:07 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
> The help info of `make C=1` is little confusing, make it clear.
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>


Applied to linux-kbuild/fixes.  Thanks!
Cao jin June 13, 2017, 9:52 a.m. UTC | #2
Yamada-san,

  I have a question on the current top level Makefile. There are
following lines, I have trouble to understand "firstword x$(MAKEFLAGS)"
in 2nd line, why there is a 'x' there?


  ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
  ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
    quiet=silent_
    tools_silent=s
  endif
  else                                    # make-3.8x
  ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
    quiet=silent_
    tools_silent=-s
  endif
  endif

  I already read & understand your patch[*] and know these lines will be
modified, but I have spent quite a few days on understanding it, so I
still want to know the purpose of 'x'.

[*]https://lkml.org/lkml/2017/5/19/371
Masahiro Yamada June 14, 2017, 1:15 a.m. UTC | #3
2017-06-13 18:52 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
> Yamada-san,
>
>   I have a question on the current top level Makefile. There are
> following lines, I have trouble to understand "firstword x$(MAKEFLAGS)"
> in 2nd line, why there is a 'x' there?
>
>
>   ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
>   ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)


I do not understand the 'x' either.

Michal suggested the code according to the following:
https://patchwork.kernel.org/patch/3291301/
(I hope Michal can help you.)


My first guess was, it was added just in case $(MAKEFLAGS) is empty.
Actually $(firstword ) seems to work with empty argument, though.
Cao jin June 14, 2017, 7:08 a.m. UTC | #4
On 06/14/2017 09:15 AM, Masahiro Yamada wrote:
> 2017-06-13 18:52 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
>> Yamada-san,
>>
>>   I have a question on the current top level Makefile. There are
>> following lines, I have trouble to understand "firstword x$(MAKEFLAGS)"
>> in 2nd line, why there is a 'x' there?
>>
>>
>>   ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
>>   ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
> 
> 
> I do not understand the 'x' either.
> 
> Michal suggested the code according to the following:
> https://patchwork.kernel.org/patch/3291301/
> (I hope Michal can help you.)
> 

It does helps.

> 
> My first guess was, it was added just in case $(MAKEFLAGS) is empty.
> Actually $(firstword ) seems to work with empty argument, though.
> 

I see, I guess you are saying it was added in case there is no
single-letter flags in $(MAKEFLAGS) while it has "--debug=jobs", that
make sense to me. Thanks very much, Yamada-san.
Michal Marek June 14, 2017, 7:32 a.m. UTC | #5
Dne 14.6.2017 v 09:08 Cao jin napsal(a):
> 
> 
> On 06/14/2017 09:15 AM, Masahiro Yamada wrote:
>> 2017-06-13 18:52 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
>>> Yamada-san,
>>>
>>>   I have a question on the current top level Makefile. There are
>>> following lines, I have trouble to understand "firstword x$(MAKEFLAGS)"
>>> in 2nd line, why there is a 'x' there?
>>>
>>>
>>>   ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
>>>   ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
>>
>>
>> I do not understand the 'x' either.
>>
>> Michal suggested the code according to the following:
>> https://patchwork.kernel.org/patch/3291301/
>> (I hope Michal can help you.)
>>
> 
> It does helps.
> 
>>
>> My first guess was, it was added just in case $(MAKEFLAGS) is empty.
>> Actually $(firstword ) seems to work with empty argument, though.
>>
> 
> I see, I guess you are saying it was added in case there is no
> single-letter flags in $(MAKEFLAGS) while it has "--debug=jobs", that
> make sense to me. Thanks very much, Yamada-san.

Well, it more than three years ago. But yes, I believe that was the
intention:

make --foo=s

x$(MAKEFLAGS) => x --foo=s
$(firstword x$(MAKEFLAGS)) => x

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index efa267a..bc9eb36 100644
--- a/Makefile
+++ b/Makefile
@@ -1417,7 +1417,7 @@  help:
 	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
 	@echo  '  make V=2   [targets] 2 => give reason for rebuild of target'
 	@echo  '  make O=dir [targets] Locate all output files in "dir", including .config'
-	@echo  '  make C=1   [targets] Check all c source with $$CHECK (sparse by default)'
+	@echo  '  make C=1   [targets] Check re-compiled c source with $$CHECK (sparse by default)'
 	@echo  '  make C=2   [targets] Force check of all c source with $$CHECK'
 	@echo  '  make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
 	@echo  '  make W=n   [targets] Enable extra gcc checks, n=1,2,3 where'