kbuild: drop $(objtree)/ prefix support for clean-files
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 30 Apr 2022 11:04:09 +0000 (20:04 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 7 May 2022 18:17:00 +0000 (03:17 +0900)
I think this hack is a bad idea. arch/powerpc/boot/Makefile is the
only and last user. Let's stop doing this.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
arch/powerpc/boot/Makefile
scripts/Makefile.clean

index 4b4827c475c6cd7c4b399752796282e27d75d98b..008bf0bff1863a5374cf5b53f34776d87143f4c0 100644 (file)
@@ -453,8 +453,8 @@ clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
 clean-kernel-base := vmlinux.strip vmlinux.bin
 clean-kernel := $(addsuffix .gz,$(clean-kernel-base))
 clean-kernel += $(addsuffix .xz,$(clean-kernel-base))
-# If not absolute clean-files are relative to $(obj).
-clean-files += $(addprefix $(objtree)/, $(clean-kernel))
+# clean-files are relative to $(obj).
+clean-files += $(addprefix ../../../, $(clean-kernel))
 
 WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
 WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
index 74cb1c5c36581d25111e8de47a6344b0f08570a6..878cec64895953897a88b798042af66fb8b1c9c4 100644 (file)
@@ -36,13 +36,7 @@ __clean-files        := \
 
 __clean-files   := $(filter-out $(no-clean-files), $(__clean-files))
 
-# clean-files is given relative to the current directory, unless it
-# starts with $(objtree)/ (which means "./", so do not add "./" unless
-# you want to delete a file from the toplevel object directory).
-
-__clean-files   := $(wildcard                                               \
-                  $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \
-                  $(filter $(objtree)/%, $(__clean-files)))
+__clean-files   := $(wildcard $(addprefix $(obj)/, $(__clean-files)))
 
 # ==========================================================================