]> git.ipfire.org Git - thirdparty/glibc.git/blame - extra-lib.mk
[powerpc] No need to enter "Ignore Exceptions Mode"
[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
b3ed8219
AS
6# to be included in that library. A sysdep Makefile can add to
7# $(lib)-sysdep_routines to include additional modules.
c23de0aa
FW
8#
9# Libraries listed in $(extra-libs-noinstall) are built, but not
10# installed.
693e7b96 11
0a951d0e 12lib := $(firstword $(extra-libs-left))
693e7b96
RM
13extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
14
193ce8dc
RM
15object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
16
3f488b9c 17ifneq (,$($(lib)-static-only-routines))
0269750c 18ifneq (,$(filter yes%,$(build-shared)$($(lib).so-version)))
3f488b9c
RM
19object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
20endif
21endif
22
a13dab1c
RM
23ifneq (,$(object-suffixes-$(lib)))
24
6aa8372e 25# Make sure these are simply-expanded variables before we append to them,
e97ec51d 26# since we want the expressions we append to be expanded right now.
6aa8372e
RM
27install-lib := $(install-lib)
28extra-objs := $(extra-objs)
29
b3ed8219
AS
30# The modules that go in $(lib).
31all-$(lib)-routines := $($(lib)-routines) $($(lib)-sysdep_routines)
32
693e7b96 33# Add each flavor of library to the lists of things to build and install.
c23de0aa 34ifeq (,$(filter $(lib), $(extra-libs-noinstall)))
193ce8dc 35install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
c23de0aa 36endif
3f488b9c 37extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
05f732b3
UD
38 $(patsubst %,%$o,$(filter-out \
39 $($(lib)-shared-only-routines),\
b3ed8219 40 $(all-$(lib)-routines))))
05f732b3 41ifneq (,$(filter .os,$(object-suffixes-$(lib))))
9dc7c64f
AS
42extra-objs += $(patsubst %,%.os,$(filter-out $($(lib)-static-only-routines),\
43 $(all-$(lib)-routines)))
44endif
45ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
46extra-objs += $(patsubst %,%.oS,$(filter $($(lib)-static-only-routines),\
47 $(all-$(lib)-routines)))
05f732b3 48endif
6aa8372e 49alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
64166d98 50 $(objpfx)$(patsubst %,$(libtype$o),\
6aa8372e 51 $(lib:lib%=%)))
693e7b96 52
e33b438a 53ifeq (,$(filter $(lib),$(extra-libs-others)))
693e7b96 54lib-noranlib: $(alltypes-$(lib))
5f0e6fc7 55ifeq (yes,$(build-shared))
edf5b2d7 56lib-noranlib: $(objpfx)$(lib).so$($(lib).so-version)
5f0e6fc7 57endif
e97ec51d
RM
58else
59others: $(alltypes-$(lib))
60endif
693e7b96 61
d06b536d
RM
62# The linked shared library is never a dependent of lib-noranlib,
63# because linking it will depend on libc.so already being built.
40a55d20 64ifneq (,$(filter .os,$(object-suffixes-$(lib))))
d705269e 65others: $(objpfx)$(lib).so$($(lib).so-version)
d06b536d
RM
66endif
67
68
693e7b96 69# Use o-iterator.mk to generate a rule for each flavor of library.
3f488b9c 70ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
693e7b96 71define o-iterator-doit
64166d98 72$(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
05f732b3
UD
73 $(patsubst %,$(objpfx)%$o,\
74 $(filter-out $($(lib)-shared-only-routines),\
b3ed8219 75 $(all-$(lib)-routines))); \
05f732b3 76 $$(build-extra-lib)
693e7b96 77endef
3f488b9c
RM
78object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
79include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
05f732b3
UD
80endif
81
82ifneq (,$(filter .os,$(object-suffixes-$(lib))))
83$(objpfx)$(patsubst %,$(libtype.os),$(lib:lib%=%)): \
3f488b9c
RM
84 $(patsubst %,$(objpfx)%.os,\
85 $(filter-out $($(lib)-static-only-routines),\
86 $(all-$(lib)-routines)))
87 $(build-extra-lib)
88endif
89
90ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
91$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
92 $(patsubst %,$(objpfx)%.oS,\
93 $(filter $($(lib)-static-only-routines),\
94 $(all-$(lib)-routines)))
05f732b3
UD
95 $(build-extra-lib)
96endif
a13dab1c 97
3f2e46a4 98ifeq ($(build-shared),yes)
f21acc89 99# Add the version script to the dependencies of the shared library.
a9ddb793
UD
100$(objpfx)$(lib).so: $(firstword $($(lib)-map) \
101 $(addprefix $(common-objpfx), \
102 $(filter $(lib).map, \
103 $(version-maps))))
104endif
f21acc89 105
a13dab1c 106endif
71319b9c 107
0a951d0e
RM
108# This will define `libof-ROUTINE := LIB' for each of the routines.
109cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines)
110ifneq (,$(cpp-srcs-left))
2bfdaedd 111include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
71319b9c 112endif