Re: [PATCH 6/6] kbuild: remove kselftest output in mrproper

From: Ricardo B. Marlière

Date: Sat Apr 11 2026 - 08:50:42 EST


On 4/10/26 4:19 PM, Shuah Khan wrote:
On 3/20/26 12:29, Ricardo B. Marlière wrote:
Selftests built with O= store generated files by default under
$(objtree)/kselftest. Those files are not removed by mrproper today, so
stale generated artifacts can survive across builds and be reused
unexpectedly.

Add kselftest to MRPROPER_FILES, so that the default kselftest output
directory as part of mrproper target.

Does this change remove kselftest build objects in-tree builds?
It didn't for me - also there is kselftest directory under
tools/selftests that has several scripts.

Can you test this for in-tree builds - I would like this work
for both.

I dropped this from my next for now. This can go through kbuild
tree.

OK! But please also drop https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=next&id=33880424308df3c2e39fa88ea74f051205ebb7b4

Thanks!



Signed-off-by: Ricardo B. Marlière <rbm@xxxxxxxx>
---
  Makefile | 1 +
  1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index c9b7bee102e8..91e6ec790a0f 100644
--- a/Makefile
+++ b/Makefile
@@ -1662,6 +1662,7 @@ MRPROPER_FILES += include/config include/generated          \
            debian snap tar-install PKGBUILD pacman \
            .config .config.old .version \
            Module.symvers \
+          kselftest \
            certs/signing_key.pem \
            certs/x509.genkey \
            vmlinux-gdb.py \


thanks,
-- Shuah