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