]> git.ipfire.org Git - thirdparty/glibc.git/blame - extra-lib.mk
* sysdeps/unix/sysv/linux/mips/clone.S (__thread_start): Re-introduce ENTRY.
[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.
693e7b96 8
0a951d0e 9lib := $(firstword $(extra-libs-left))
693e7b96
RM
10extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
11
193ce8dc
RM
12object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
13
a13dab1c
RM
14ifneq (,$(object-suffixes-$(lib)))
15
6aa8372e 16# Make sure these are simply-expanded variables before we append to them,
e97ec51d 17# since we want the expressions we append to be expanded right now.
6aa8372e
RM
18install-lib := $(install-lib)
19extra-objs := $(extra-objs)
20
b3ed8219
AS
21# The modules that go in $(lib).
22all-$(lib)-routines := $($(lib)-routines) $($(lib)-sysdep_routines)
23
693e7b96 24# Add each flavor of library to the lists of things to build and install.
193ce8dc 25install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
05f732b3
UD
26extra-objs += $(foreach o,$(object-suffixes-$(lib):.os=),\
27 $(patsubst %,%$o,$(filter-out \
28 $($(lib)-shared-only-routines),\
b3ed8219 29 $(all-$(lib)-routines))))
05f732b3 30ifneq (,$(filter .os,$(object-suffixes-$(lib))))
b3ed8219 31extra-objs += $(all-$(lib)-routines:%=%.os)
05f732b3 32endif
6aa8372e 33alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
64166d98 34 $(objpfx)$(patsubst %,$(libtype$o),\
6aa8372e 35 $(lib:lib%=%)))
693e7b96 36
e33b438a 37ifeq (,$(filter $(lib),$(extra-libs-others)))
693e7b96 38lib-noranlib: $(alltypes-$(lib))
5f0e6fc7 39ifeq (yes,$(build-shared))
edf5b2d7 40lib-noranlib: $(objpfx)$(lib).so$($(lib).so-version)
5f0e6fc7 41endif
e97ec51d
RM
42else
43others: $(alltypes-$(lib))
44endif
693e7b96 45
d06b536d
RM
46# The linked shared library is never a dependent of lib-noranlib,
47# because linking it will depend on libc.so already being built.
40a55d20 48ifneq (,$(filter .os,$(object-suffixes-$(lib))))
d705269e 49others: $(objpfx)$(lib).so$($(lib).so-version)
d06b536d
RM
50endif
51
52
693e7b96 53# Use o-iterator.mk to generate a rule for each flavor of library.
74eee886 54ifneq (,$(filter-out .os,$(object-suffixes-$(lib))))
693e7b96 55define o-iterator-doit
64166d98 56$(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
05f732b3
UD
57 $(patsubst %,$(objpfx)%$o,\
58 $(filter-out $($(lib)-shared-only-routines),\
b3ed8219 59 $(all-$(lib)-routines))); \
05f732b3 60 $$(build-extra-lib)
693e7b96 61endef
05f732b3
UD
62object-suffixes-left = $(object-suffixes-$(lib):.os=)
63include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib):.os=))
64endif
65
66ifneq (,$(filter .os,$(object-suffixes-$(lib))))
67$(objpfx)$(patsubst %,$(libtype.os),$(lib:lib%=%)): \
b3ed8219 68 $(all-$(lib)-routines:%=$(objpfx)%.os)
05f732b3
UD
69 $(build-extra-lib)
70endif
a13dab1c 71
a9ddb793 72ifeq ($(versioning),yes)
f21acc89 73# Add the version script to the dependencies of the shared library.
a9ddb793
UD
74$(objpfx)$(lib).so: $(firstword $($(lib)-map) \
75 $(addprefix $(common-objpfx), \
76 $(filter $(lib).map, \
77 $(version-maps))))
78endif
f21acc89 79
a13dab1c 80endif
71319b9c 81
0a951d0e
RM
82# This will define `libof-ROUTINE := LIB' for each of the routines.
83cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines)
84ifneq (,$(cpp-srcs-left))
85include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
71319b9c 86endif
0a951d0e
RM
87
88CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1