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


Groups > linux.kernel > #1731295 > unrolled thread

[PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case

Started byShuah Khan <shuahkh@osg.samsung.com>
First post2017-09-13 02:00 +0200
Last post2017-09-20 19:40 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-13 02:00 +0200
    Re: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for  make O=dir case Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-19 01:20 +0200
      Re: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for  make O=dir case Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-20 05:50 +0200
        Re: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for  make O=dir case Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-20 19:40 +0200

#1731295 — [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-09-13 02:00 +0200
Subject[PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case
Message-ID<up3fY-83p-15@gated-at.bofh.it>
kselftest and kselftest-clean targets fail when object directory is
specified to relocate objects. Fix it so it can find the source tree
to build from.

make O=/tmp/kselftest_top kselftest

make[1]: Entering directory '/tmp/kselftest_top'
make[2]: Entering directory '/tmp/kselftest_top'
make[2]: *** tools/testing/selftests: No such file or directory.  Stop.
make[2]: Leaving directory '/tmp/kselftest_top'
./linux-kselftest/Makefile:1185: recipe for target
'kselftest' failed
make[1]: *** [kselftest] Error 2
make[1]: Leaving directory '/tmp/kselftest_top'
Makefile:145: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 Makefile | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index eccb8d704c23..6a85322d0b3e 100644
--- a/Makefile
+++ b/Makefile
@@ -1180,13 +1180,18 @@ headers_check: headers_install
 # ---------------------------------------------------------------------------
 # Kernel selftest
 
+PHONY += __kselftest
+	kselftest_src := tools/testing/selftests
+	ifneq ($(KBUILD_SRC),)
+		kselftest_src := $(KBUILD_SRC)/tools/testing/selftests
+	endif
 PHONY += kselftest
-kselftest:
-	$(Q)$(MAKE) -C tools/testing/selftests run_tests
+kselftest: __kselftest
+	$(Q)$(MAKE) -C $(kselftest_src) run_tests
 
 PHONY += kselftest-clean
-kselftest-clean:
-	$(Q)$(MAKE) -C tools/testing/selftests clean
+kselftest-clean: __kselftest
+	$(Q)$(MAKE) -C $(kselftest_src) clean
 
 PHONY += kselftest-merge
 kselftest-merge:
-- 
2.11.0

[toc] | [next] | [standalone]


#1734538 — Re: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-09-19 01:20 +0200
SubjectRe: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case
Message-ID<urduy-4KP-25@gated-at.bofh.it>
In reply to#1731295
On 09/12/2017 05:52 PM, Shuah Khan wrote:
> kselftest and kselftest-clean targets fail when object directory is
> specified to relocate objects. Fix it so it can find the source tree
> to build from.
> 
> make O=/tmp/kselftest_top kselftest
> 
> make[1]: Entering directory '/tmp/kselftest_top'
> make[2]: Entering directory '/tmp/kselftest_top'
> make[2]: *** tools/testing/selftests: No such file or directory.  Stop.
> make[2]: Leaving directory '/tmp/kselftest_top'
> ./linux-kselftest/Makefile:1185: recipe for target
> 'kselftest' failed
> make[1]: *** [kselftest] Error 2
> make[1]: Leaving directory '/tmp/kselftest_top'
> Makefile:145: recipe for target 'sub-make' failed
> make: *** [sub-make] Error 2
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>

Hi Masahiro/Michal,

Is it okay to take this patch via linux-kselftest git? If you are okay
with that, please Ack it and I will plan to include this in my update.

thanks,
-- Shuah


> ---
>  Makefile | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index eccb8d704c23..6a85322d0b3e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1180,13 +1180,18 @@ headers_check: headers_install
>  # ---------------------------------------------------------------------------
>  # Kernel selftest
>  
> +PHONY += __kselftest
> +	kselftest_src := tools/testing/selftests
> +	ifneq ($(KBUILD_SRC),)
> +		kselftest_src := $(KBUILD_SRC)/tools/testing/selftests
> +	endif
>  PHONY += kselftest
> -kselftest:
> -	$(Q)$(MAKE) -C tools/testing/selftests run_tests
> +kselftest: __kselftest
> +	$(Q)$(MAKE) -C $(kselftest_src) run_tests
>  
>  PHONY += kselftest-clean
> -kselftest-clean:
> -	$(Q)$(MAKE) -C tools/testing/selftests clean
> +kselftest-clean: __kselftest
> +	$(Q)$(MAKE) -C $(kselftest_src) clean
>  
>  PHONY += kselftest-merge
>  kselftest-merge:
> 

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


#1735424 — Re: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2017-09-20 05:50 +0200
SubjectRe: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case
Message-ID<urEbn-5To-1@gated-at.bofh.it>
In reply to#1734538
2017-09-19 8:14 GMT+09:00 Shuah Khan <shuahkh@osg.samsung.com>:
> On 09/12/2017 05:52 PM, Shuah Khan wrote:
>> kselftest and kselftest-clean targets fail when object directory is
>> specified to relocate objects. Fix it so it can find the source tree
>> to build from.
>>
>> make O=/tmp/kselftest_top kselftest
>>
>> make[1]: Entering directory '/tmp/kselftest_top'
>> make[2]: Entering directory '/tmp/kselftest_top'
>> make[2]: *** tools/testing/selftests: No such file or directory.  Stop.
>> make[2]: Leaving directory '/tmp/kselftest_top'
>> ./linux-kselftest/Makefile:1185: recipe for target
>> 'kselftest' failed
>> make[1]: *** [kselftest] Error 2
>> make[1]: Leaving directory '/tmp/kselftest_top'
>> Makefile:145: recipe for target 'sub-make' failed
>> make: *** [sub-make] Error 2
>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>
> Hi Masahiro/Michal,
>
> Is it okay to take this patch via linux-kselftest git? If you are okay
> with that, please Ack it and I will plan to include this in my update.
>
> thanks,
> -- Shuah
>
>
>> ---
>>  Makefile | 13 +++++++++----
>>  1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index eccb8d704c23..6a85322d0b3e 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1180,13 +1180,18 @@ headers_check: headers_install
>>  # ---------------------------------------------------------------------------
>>  # Kernel selftest
>>
>> +PHONY += __kselftest
>> +     kselftest_src := tools/testing/selftests
>> +     ifneq ($(KBUILD_SRC),)
>> +             kselftest_src := $(KBUILD_SRC)/tools/testing/selftests
>> +     endif
>>  PHONY += kselftest
>> -kselftest:
>> -     $(Q)$(MAKE) -C tools/testing/selftests run_tests
>> +kselftest: __kselftest
>> +     $(Q)$(MAKE) -C $(kselftest_src) run_tests
>>
>>  PHONY += kselftest-clean
>> -kselftest-clean:
>> -     $(Q)$(MAKE) -C tools/testing/selftests clean
>> +kselftest-clean: __kselftest
>> +     $(Q)$(MAKE) -C $(kselftest_src) clean
>>
>>  PHONY += kselftest-merge
>>  kselftest-merge:
>>
>

Why don't you simply add $(srctree)/ to tools/testing/selftests?

Like,

PHONY += kselftest
kselftest:
        $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests

PHONY += kselftest-clean
kselftest-clean:
        $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean



-- 
Best Regards
Masahiro Yamada

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


#1735964 — Re: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-09-20 19:40 +0200
SubjectRe: [PATCH 01/11] Makefile: kselftest and kselftest-clean fail for make O=dir case
Message-ID<urR8C-67N-25@gated-at.bofh.it>
In reply to#1735424
On 09/19/2017 09:39 PM, Masahiro Yamada wrote:
> 2017-09-19 8:14 GMT+09:00 Shuah Khan <shuahkh@osg.samsung.com>:
>> On 09/12/2017 05:52 PM, Shuah Khan wrote:
>>> kselftest and kselftest-clean targets fail when object directory is
>>> specified to relocate objects. Fix it so it can find the source tree
>>> to build from.
>>>
>>> make O=/tmp/kselftest_top kselftest
>>>
>>> make[1]: Entering directory '/tmp/kselftest_top'
>>> make[2]: Entering directory '/tmp/kselftest_top'
>>> make[2]: *** tools/testing/selftests: No such file or directory.  Stop.
>>> make[2]: Leaving directory '/tmp/kselftest_top'
>>> ./linux-kselftest/Makefile:1185: recipe for target
>>> 'kselftest' failed
>>> make[1]: *** [kselftest] Error 2
>>> make[1]: Leaving directory '/tmp/kselftest_top'
>>> Makefile:145: recipe for target 'sub-make' failed
>>> make: *** [sub-make] Error 2
>>>
>>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>>
>> Hi Masahiro/Michal,
>>
>> Is it okay to take this patch via linux-kselftest git? If you are okay
>> with that, please Ack it and I will plan to include this in my update.
>>
>> thanks,
>> -- Shuah
>>
>>
>>> ---
>>>  Makefile | 13 +++++++++----
>>>  1 file changed, 9 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index eccb8d704c23..6a85322d0b3e 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -1180,13 +1180,18 @@ headers_check: headers_install
>>>  # ---------------------------------------------------------------------------
>>>  # Kernel selftest
>>>
>>> +PHONY += __kselftest
>>> +     kselftest_src := tools/testing/selftests
>>> +     ifneq ($(KBUILD_SRC),)
>>> +             kselftest_src := $(KBUILD_SRC)/tools/testing/selftests
>>> +     endif
>>>  PHONY += kselftest
>>> -kselftest:
>>> -     $(Q)$(MAKE) -C tools/testing/selftests run_tests
>>> +kselftest: __kselftest
>>> +     $(Q)$(MAKE) -C $(kselftest_src) run_tests
>>>
>>>  PHONY += kselftest-clean
>>> -kselftest-clean:
>>> -     $(Q)$(MAKE) -C tools/testing/selftests clean
>>> +kselftest-clean: __kselftest
>>> +     $(Q)$(MAKE) -C $(kselftest_src) clean
>>>
>>>  PHONY += kselftest-merge
>>>  kselftest-merge:
>>>
>>
> 
> Why don't you simply add $(srctree)/ to tools/testing/selftests?
> 
> Like,
> 
> PHONY += kselftest
> kselftest:
>         $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests
> 
> PHONY += kselftest-clean
> kselftest-clean:
>         $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean
> 
> 
> 

I started with the simpler logic and decided to add explicit check
for KBUILD_SRC due to isolate some error I was seeing from sub-make.

Forgot to go back and revisit the simpler logic. Thanks for catching
this. I am not seeing any issues with the simplified. Sending v2.

Thanks for the review.

-- Shuah

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web