|
44 | 44 | obj-y := $(filter-out %/, $(obj-y)) |
45 | 45 | endif |
46 | 46 |
|
47 | | -# Expand $(foo-objs) $(foo-y) by calling $(call suffix-search,foo.o,-objs -y) |
48 | | -suffix-search = $(strip $(foreach s, $2, $($(1:.o=$s)))) |
| 47 | +# Expand $(foo-objs) $(foo-y) etc. by replacing their individuals |
| 48 | +suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s)))) |
| 49 | +# List composite targets that are constructed by combining other targets |
| 50 | +multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $m))) |
| 51 | +# List primitive targets that are compiled from source files |
| 52 | +real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $(call suffix-search, $m, $2, $3), $m)) |
| 53 | + |
49 | 54 | # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object |
50 | | -multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $m))) |
51 | | -multi-obj-y := $(call multi-search,$(obj-y),-objs -y) |
52 | | -multi-obj-m := $(call multi-search,$(obj-m),-objs -y -m) |
| 55 | +multi-obj-y := $(call multi-search, $(obj-y), .o, -objs -y) |
| 56 | +multi-obj-m := $(call multi-search, $(obj-m), .o, -objs -y -m) |
53 | 57 | multi-obj-ym := $(multi-obj-y) $(multi-obj-m) |
54 | 58 |
|
55 | 59 | # Replace multi-part objects by their individual parts, |
56 | 60 | # including built-in.a from subdirectories |
57 | | -real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $(call suffix-search, $m, $2), $m)) |
58 | | -real-obj-y := $(call real-search, $(obj-y),-objs -y) |
59 | | -real-obj-m := $(call real-search, $(obj-m),-objs -y -m) |
| 61 | +real-obj-y := $(call real-search, $(obj-y), .o, -objs -y) |
| 62 | +real-obj-m := $(call real-search, $(obj-m), .o, -objs -y -m) |
60 | 63 |
|
61 | 64 | always-y += $(always-m) |
62 | 65 |
|
|
0 commit comments