Commit 8212f898 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

kbuild: use more subdir- for visiting subdirectories while cleaning



Documentation/kbuild/makefiles.rst suggests to use "archclean" for
cleaning arch/$(SRCARCH)/boot/, but it is not a hard requirement.

Since commit d92cc4d5 ("kbuild: require all architectures to have
arch/$(SRCARCH)/Kbuild"), we can use the "subdir- += boot" trick for
all architectures. This can take advantage of the parallel option (-j)
for "make clean".

I also cleaned up the comments in arch/$(SRCARCH)/Makefile. The "archdep"
target no longer exists.

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
parent 10c6ae27
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -1050,22 +1050,9 @@ is not sufficient this sometimes needs to be explicit.
The above assignment instructs kbuild to descend down in the
directory compressed/ when "make clean" is executed.

To support the clean infrastructure in the Makefiles that build the
final bootimage there is an optional target named archclean:

	Example::

		#arch/x86/Makefile
		archclean:
			$(Q)$(MAKE) $(clean)=arch/x86/boot

When "make clean" is executed, make will descend down in arch/x86/boot,
and clean as usual. The Makefile located in arch/x86/boot/ may use
the subdir- trick to descend further down.

Note 1: arch/$(SRCARCH)/Makefile cannot use "subdir-", because that file is
included in the top level makefile, and the kbuild infrastructure
is not operational at that point.
included in the top level makefile. Instead, arch/$(SRCARCH)/Kbuild can use
"subdir-".

Note 2: All directories listed in core-y, libs-y, drivers-y and net-y will
be visited during "make clean".
+3 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
obj-y			+= kernel/ mm/
obj-$(CONFIG_MATHEMU)	+= math-emu/

# for cleaning
subdir- += boot
+0 −3
Original line number Diff line number Diff line
@@ -55,9 +55,6 @@ $(boot)/vmlinux.gz: vmlinux
bootimage bootpfile bootpzfile: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

archclean:
	$(Q)$(MAKE) $(clean)=$(boot)

archheaders:
	$(Q)$(MAKE) $(build)=arch/alpha/kernel/syscalls all

+3 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
obj-y += kernel/
obj-y += mm/

# for cleaning
subdir- += boot
+0 −3
Original line number Diff line number Diff line
@@ -112,6 +112,3 @@ uImage: $(uimage-default-y)
	@$(kecho) '  Image $(boot)/uImage is ready'

CLEAN_FILES += $(boot)/uImage

archclean:
	$(Q)$(MAKE) $(clean)=$(boot)
Loading