提交 f97cf399 编写于 作者: M Masahiro Yamada

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 54b8ae66 ("kbuild:
change *FLAGS_<basetarget>.o to take the path relative to $(obj)").
Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
上级 9eef99f7
...@@ -236,9 +236,9 @@ endif ...@@ -236,9 +236,9 @@ endif
# Usage: # Usage:
# $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add) # $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add)
define multi_depend define multi_depend
$(foreach m, $(notdir $1), \ $(foreach m, $1, \
$(eval $(obj)/$m: \ $(eval $m: \
$(addprefix $(obj)/, $(call suffix-search, $m, $2, $3)))) $(addprefix $(obj)/, $(call suffix-search, $(patsubst $(obj)/%,%,$m), $2, $3))))
endef endef
# Copy a file # Copy a file
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册