Makefile: kselftest and kselftest-clean fail for make O=dir case

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>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
Shuah Khan 2017-09-06 16:44:35 -06:00
Родитель 06e8852cee
Коммит 2bc84526d1
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -1172,11 +1172,11 @@ headers_check: headers_install
PHONY += kselftest PHONY += kselftest
kselftest: kselftest:
$(Q)$(MAKE) -C tools/testing/selftests run_tests $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests
PHONY += kselftest-clean PHONY += kselftest-clean
kselftest-clean: kselftest-clean:
$(Q)$(MAKE) -C tools/testing/selftests clean $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean
PHONY += kselftest-merge PHONY += kselftest-merge
kselftest-merge: kselftest-merge: