Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+12 -14
+5
scripts/Kbuild.include
··· 41 41 stringify = $(squote)$(quote)$1$(quote)$(squote) 42 42 43 43 ### 44 + # The path to Kbuild or Makefile. Kbuild has precedence over Makefile. 45 + kbuild-dir = $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 46 + kbuild-file = $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 47 + 48 + ### 44 49 # Easy method for doing a status message 45 50 kecho := : 46 51 quiet_kecho := echo
+3 -3
scripts/Makefile.asm-generic
··· 10 10 all: 11 11 12 12 src := $(subst /generated,,$(obj)) 13 - -include $(src)/Kbuild 13 + 14 + include $(srctree)/scripts/Kbuild.include 15 + -include $(kbuild-file) 14 16 15 17 # $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case. 16 18 ifneq ($(SRCARCH),um) 17 19 include $(srctree)/$(generic)/Kbuild 18 20 endif 19 - 20 - include $(srctree)/scripts/Kbuild.include 21 21 22 22 redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) 23 23 redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f)))
+1 -5
scripts/Makefile.build
··· 38 38 39 39 include $(srctree)/scripts/Kbuild.include 40 40 include $(srctree)/scripts/Makefile.compiler 41 - 42 - # The filename Kbuild has precedence over Makefile 43 - kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 44 - include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 45 - 41 + include $(kbuild-file) 46 42 include $(srctree)/scripts/Makefile.lib 47 43 48 44 # Do not include hostprogs rules unless needed.
+1 -4
scripts/Makefile.clean
··· 9 9 __clean: 10 10 11 11 include $(srctree)/scripts/Kbuild.include 12 - 13 - # The filename Kbuild has precedence over Makefile 14 - kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 15 - include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 12 + include $(kbuild-file) 16 13 17 14 # Figure out what we need to build from the various variables 18 15 # ==========================================================================
+1 -1
scripts/Makefile.dtbinst
··· 15 15 16 16 include include/config/auto.conf 17 17 include $(srctree)/scripts/Kbuild.include 18 - include $(src)/Makefile 18 + include $(kbuild-file) 19 19 20 20 dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) 21 21 subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
+1 -1
scripts/Makefile.modpost
··· 93 93 src := $(obj) 94 94 95 95 # Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS 96 - include $(or $(wildcard $(src)/Kbuild), $(src)/Makefile) 96 + include $(kbuild-file) 97 97 98 98 module.symvers-if-present := $(wildcard Module.symvers) 99 99 output-symdump := $(KBUILD_EXTMOD)/Module.symvers