kbuild: add kbuild-file macro

While building, installing, cleaning, Kbuild visits sub-directories
and includes 'Kbuild' or 'Makefile' that exists there.

Add 'kbuild-file' macro, and reuse it from scripts/Makefie.*

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Reviewed-by: Alexander Lobakin <alobakin@pm.me>
Tested-by: Alexander Lobakin <alobakin@pm.me>
This commit is contained in:
Masahiro Yamada
2022-11-19 04:15:50 +09:00
parent 5724ac5589
commit a2430b25c3
6 changed files with 12 additions and 14 deletions

View File

@@ -10,15 +10,15 @@ PHONY := all
all:
src := $(subst /generated,,$(obj))
-include $(src)/Kbuild
include $(srctree)/scripts/Kbuild.include
-include $(kbuild-file)
# $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case.
ifneq ($(SRCARCH),um)
include $(srctree)/$(generic)/Kbuild
endif
include $(srctree)/scripts/Kbuild.include
redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))
redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f)))
redundant := $(sort $(redundant))