mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 05:04:20 +00:00
kbuild: parameterize the .o part of suffix-search
The suffix-search macro hard-codes the suffix, '.o'.
Make it a parameter so that the multi-search and real-search macros
can be reused for foo-dtbs syntax introduced by commit 15d16d6dad
("kbuild: Add generic rule to apply fdtoverlay").
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
23243c1ace
commit
44f87191d1
1 changed files with 11 additions and 8 deletions
|
@ -44,19 +44,22 @@ else
|
||||||
obj-y := $(filter-out %/, $(obj-y))
|
obj-y := $(filter-out %/, $(obj-y))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Expand $(foo-objs) $(foo-y) by calling $(call suffix-search,foo.o,-objs -y)
|
# Expand $(foo-objs) $(foo-y) etc. by replacing their individuals
|
||||||
suffix-search = $(strip $(foreach s, $2, $($(1:.o=$s))))
|
suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s))))
|
||||||
|
# List composite targets that are constructed by combining other targets
|
||||||
|
multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $m)))
|
||||||
|
# List primitive targets that are compiled from source files
|
||||||
|
real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $(call suffix-search, $m, $2, $3), $m))
|
||||||
|
|
||||||
# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
|
# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
|
||||||
multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $m)))
|
multi-obj-y := $(call multi-search, $(obj-y), .o, -objs -y)
|
||||||
multi-obj-y := $(call multi-search,$(obj-y),-objs -y)
|
multi-obj-m := $(call multi-search, $(obj-m), .o, -objs -y -m)
|
||||||
multi-obj-m := $(call multi-search,$(obj-m),-objs -y -m)
|
|
||||||
multi-obj-ym := $(multi-obj-y) $(multi-obj-m)
|
multi-obj-ym := $(multi-obj-y) $(multi-obj-m)
|
||||||
|
|
||||||
# Replace multi-part objects by their individual parts,
|
# Replace multi-part objects by their individual parts,
|
||||||
# including built-in.a from subdirectories
|
# including built-in.a from subdirectories
|
||||||
real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $(call suffix-search, $m, $2), $m))
|
real-obj-y := $(call real-search, $(obj-y), .o, -objs -y)
|
||||||
real-obj-y := $(call real-search, $(obj-y),-objs -y)
|
real-obj-m := $(call real-search, $(obj-m), .o, -objs -y -m)
|
||||||
real-obj-m := $(call real-search, $(obj-m),-objs -y -m)
|
|
||||||
|
|
||||||
always-y += $(always-m)
|
always-y += $(always-m)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue