The complicated part of multi_depend is the same as suffix-search. Reuse it.
Unified · Split
| @@ -238,7 +238,7 @@ endif · 237 unmodified lines | ||
| 238 | 238 | define multi_depend |
| 239 | 239 | $(foreach m, $(notdir $1), \ |
| 240 | 240 | $(eval $(obj)/$m: \ |
| 241 | − $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) | |
| 241 | + $(addprefix $(obj)/, $(call suffix-search, $m, $2, $3)))) | |
| 242 | 242 | endef |
| 243 | 243 | |
| 244 | 244 | # Copy a file |