summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-06-01 14:56:55 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-06-01 21:50:45 +0900
commit0a8820e7f807158670d3400974b20691cd8774d9 (patch)
tree3b6e04e1daab2743eb2cd7fde64b301da0dc6dc3 /scripts/Makefile.lib
parentfb2d99be8919d63ff5c48f33bff4847387c6742b (diff)
downloadlinux-stable-0a8820e7f807158670d3400974b20691cd8774d9.tar.gz
linux-stable-0a8820e7f807158670d3400974b20691cd8774d9.tar.bz2
linux-stable-0a8820e7f807158670d3400974b20691cd8774d9.zip
kbuild: refactor subdir-ym calculation
Remove the unneeded variables, __subdir-y and __subdir-m. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib13
1 files changed, 4 insertions, 9 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0d931cc0df94..748e44d5a1e3 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -39,16 +39,14 @@ ifdef need-modorder
modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
endif
+# Subdirectories we need to descend into
+subdir-ym := $(sort $(subdir-y) $(subdir-m) \
+ $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-m))))
+
# Handle objects in subdirs
# ---------------------------------------------------------------------------
# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.a
-# and add the directory to the list of dirs to descend into: $(subdir-y)
# o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
-# and add the directory to the list of dirs to descend into: $(subdir-m)
-__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
-subdir-y += $(__subdir-y)
-__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
-subdir-m += $(__subdir-m)
ifdef need-builtin
obj-y := $(patsubst %/, %/built-in.a, $(obj-y))
else
@@ -56,9 +54,6 @@ obj-y := $(filter-out %/, $(obj-y))
endif
obj-m := $(filter-out %/, $(obj-m))
-# Subdirectories we need to descend into
-subdir-ym := $(sort $(subdir-y) $(subdir-m))
-
# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m))))
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m))))