kbuild: make multi_depend work with targets in subdirectory
[linux-2.6-microblaze.git] / scripts / Makefile.lib
index d56cda3..0453a19 100644 (file)
@@ -236,9 +236,9 @@ endif
 # Usage:
 #   $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add)
 define multi_depend
-$(foreach m, $(notdir $1), \
-       $(eval $(obj)/$m: \
-       $(addprefix $(obj)/, $(call suffix-search, $m, $2, $3))))
+$(foreach m, $1, \
+       $(eval $m: \
+       $(addprefix $(obj)/, $(call suffix-search, $(patsubst $(obj)/%,%,$m), $2, $3))))
 endef
 
 # Copy a file