|
56 | 56 | obj-y := $(filter-out %/, $(obj-y))
|
57 | 57 | endif
|
58 | 58 |
|
| 59 | +# Expand $(foo-objs) $(foo-y) by calling $(call suffix-search,foo.o,-objs -y) |
| 60 | +suffix-search = $(foreach s,$(2),$($(1:.o=$s))) |
59 | 61 | # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
|
60 |
| -multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m)))) |
61 |
| -multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m)))) |
| 62 | +multi-search = $(sort $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)), $(m)))) |
| 63 | +multi-used-y := $(call multi-search,$(obj-y),-objs -y) |
| 64 | +multi-used-m := $(call multi-search,$(obj-m),-objs -y -m) |
62 | 65 | multi-used := $(multi-used-y) $(multi-used-m)
|
63 | 66 |
|
64 | 67 | # Replace multi-part objects by their individual parts,
|
65 | 68 | # including built-in.a from subdirectories
|
66 |
| -real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) |
67 |
| -real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) |
| 69 | +real-search = $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)),$(call suffix-search,$(m),$(2)),$(m))) |
| 70 | +real-obj-y := $(call real-search, $(obj-y),-objs -y) |
| 71 | +real-obj-m := $(call real-search, $(obj-m),-objs -y -m) |
68 | 72 |
|
69 | 73 | always-y += $(always-m)
|
70 | 74 |
|
|
0 commit comments