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: make multi_depend work with targets in subdirectory

Precisely speaking, when you get the stem of the path, you should use
$(patsubst $(obj)/%,%,...) instead of $(notdir ...).

I do not see this usecase, but if you create a composite object in a
subdirectory, the Makefile should look like this:

obj-$(CONFIG_FOO) += dir/foo.o
dir/foo-objs := dir/foo1.o dir/foo2.o

The member objects should be assigned to dir/foo-objs instead of
foo-objs.

This syntax is more consistent with commit 54b8ae66ae1a ("kbuild:
change *FLAGS_<basetarget>.o to take the path relative to $(obj)").

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

+3 -3
+3 -3
scripts/Makefile.lib
··· 236 236 # Usage: 237 237 # $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add) 238 238 define multi_depend 239 - $(foreach m, $(notdir $1), \ 240 - $(eval $(obj)/$m: \ 241 - $(addprefix $(obj)/, $(call suffix-search, $m, $2, $3)))) 239 + $(foreach m, $1, \ 240 + $(eval $m: \ 241 + $(addprefix $(obj)/, $(call suffix-search, $(patsubst $(obj)/%,%,$m), $2, $3)))) 242 242 endef 243 243 244 244 # Copy a file