mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
kbuild: list sub-directories in ./Kbuild
Use the ordinary obj-y syntax to list subdirectories.
Note1:
Previously, the link order of lib-y depended on CONFIG_MODULES; lib-y
was linked before drivers-y when CONFIG_MODULES=y, otherwise after
drivers-y. This was a bug of commit 7273ad2b08 ("kbuild: link lib-y
objects to vmlinux forcibly when CONFIG_MODULES=y"), but it was not a
big deal after all. Now, all objects listed in lib-y are linked last,
irrespective of CONFIG_MODULES.
Note2:
Finally, the single target build in arch/*/lib/ works correctly. There was
a bug report about this. [1]
$ make ARCH=arm arch/arm/lib/findbit.o
CALL scripts/checksyscalls.sh
AS arch/arm/lib/findbit.o
[1]: https://lore.kernel.org/linux-kbuild/YvUQOwL6lD4%2F5%2FU6@shell.armlinux.org.uk/
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
This commit is contained in:
@@ -89,6 +89,7 @@ always-y += $(dtb-y)
|
||||
|
||||
# Add subdir path
|
||||
|
||||
ifneq ($(obj),.)
|
||||
extra-y := $(addprefix $(obj)/,$(extra-y))
|
||||
always-y := $(addprefix $(obj)/,$(always-y))
|
||||
targets := $(addprefix $(obj)/,$(targets))
|
||||
@@ -100,6 +101,7 @@ multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m))
|
||||
multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y))
|
||||
real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y))
|
||||
subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
|
||||
endif
|
||||
|
||||
# Finds the multi-part object the current object will be linked into.
|
||||
# If the object belongs to two or more multi-part objects, list them all.
|
||||
|
||||
Reference in New Issue
Block a user