diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-08-06 02:39:19 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-08-14 13:25:11 -0400 |
commit | 33e84f2e79659e410c379b530dac57779f201d15 (patch) | |
tree | 7a1fbc231bd721a8c0f00064baef3a4da645bf0b | |
parent | f6545bec969358eace40419aff26a2a236e0b813 (diff) |
kbuild: treat an object as multi-used when $(foo-) is set
Currently, Kbuild treats an object as multi-used when any of
$(foo-objs), $(foo-y), $(foo-m) is set. It makes more sense to
check $(foo-) as well.
In the context of foo-$(CONFIG_FOO_FEATURE1), CONFIG_FOO_FEATURE1
could be unset.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | scripts/Makefile.lib | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 49d20f356263..264611972c4a 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -41,9 +41,9 @@ obj-m := $(filter-out %/, $(obj-m)) | |||
41 | # Subdirectories we need to descend into | 41 | # Subdirectories we need to descend into |
42 | subdir-ym := $(sort $(subdir-y) $(subdir-m)) | 42 | subdir-ym := $(sort $(subdir-y) $(subdir-m)) |
43 | 43 | ||
44 | # if $(foo-objs), $(foo-y), or $(foo-m) exists, foo.o is a composite object | 44 | # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object |
45 | multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) | 45 | multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m)))) |
46 | multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m)))) | 46 | multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m)))) |
47 | multi-used := $(multi-used-y) $(multi-used-m) | 47 | multi-used := $(multi-used-y) $(multi-used-m) |
48 | 48 | ||
49 | # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to | 49 | # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to |
@@ -52,8 +52,8 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y)) | |||
52 | 52 | ||
53 | # Replace multi-part objects by their individual parts, | 53 | # Replace multi-part objects by their individual parts, |
54 | # including built-in.a from subdirectories | 54 | # including built-in.a from subdirectories |
55 | real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) | 55 | real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) |
56 | real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) | 56 | real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) |
57 | 57 | ||
58 | # DTB | 58 | # DTB |
59 | # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built | 59 | # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built |