]> git.ipfire.org Git - thirdparty/glibc.git/blame - extra-lib.mk
* Makerules (stub-$(subdir)): Put cmds including cd inside (...) with
[thirdparty/glibc.git] / extra-lib.mk
CommitLineData
693e7b96
RM
1# This file is included several times in a row, once
2# for each element of $(extra-libs). $(extra-libs-left)
3# is initialized first to $(extra-libs) so that with each
4# inclusion, we advance $(lib) to the next library name (e.g. libfoo).
5# The variable $($(lib)-routines) defines the list of modules
6# to be included in that library.
7
8lib := $(firstword $(extra-libs-left))
9extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
10
193ce8dc
RM
11object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
12
a13dab1c
RM
13ifneq (,$(object-suffixes-$(lib)))
14
6aa8372e 15# Make sure these are simply-expanded variables before we append to them,
e97ec51d 16# since we want the expressions we append to be expanded right now.
6aa8372e
RM
17install-lib := $(install-lib)
18extra-objs := $(extra-objs)
19
693e7b96 20# Add each flavor of library to the lists of things to build and install.
193ce8dc
RM
21install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
22extra-objs += $(foreach o,$(object-suffixes-$(lib)),$($(lib)-routines:=$o))
6aa8372e 23alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
2e516341 24 $(common-objpfx)$(patsubst %,$(libtype$o),\
6aa8372e 25 $(lib:lib%=%)))
193ce8dc 26ifneq (,$(filter .so,$(object-suffixes-$(lib))))
2e516341 27alltypes-$(lib) += $(common-objpfx)$(lib).so
693e7b96
RM
28endif
29
3bbceb12 30ifeq (,$($(lib)-no-lib-dep))
693e7b96 31lib-noranlib: $(alltypes-$(lib))
e97ec51d
RM
32else
33others: $(alltypes-$(lib))
34endif
693e7b96
RM
35
36# Use o-iterator.mk to generate a rule for each flavor of library.
37define o-iterator-doit
2e516341 38$(common-objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
693e7b96
RM
39 $($(lib)-routines:%=$(objpfx)%$o); $$(build-extra-lib)
40endef
193ce8dc 41object-suffixes-left = $(object-suffixes-$(lib))
11872325 42include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib)))
a13dab1c
RM
43
44endif