]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | lib := $(firstword $(extra-libs-left)) | |
9 | extra-libs-left := $(filter-out $(lib),$(extra-libs-left)) | |
10 | ||
193ce8dc RM |
11 | object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes)) |
12 | ||
a13dab1c RM |
13 | ifneq (,$(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 |
17 | install-lib := $(install-lib) |
18 | extra-objs := $(extra-objs) | |
19 | ||
693e7b96 | 20 | # Add each flavor of library to the lists of things to build and install. |
193ce8dc | 21 | install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) |
84724245 RM |
22 | extra-objs += $(foreach o,$(object-suffixes-$(lib)),\ |
23 | $(patsubst %,%$o,$($(lib)-routines))) | |
6aa8372e | 24 | alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\ |
64166d98 | 25 | $(objpfx)$(patsubst %,$(libtype$o),\ |
6aa8372e | 26 | $(lib:lib%=%))) |
693e7b96 | 27 | |
dbe31b9a | 28 | ifeq (,$(filter $(lib),extra-libs-others)) |
693e7b96 | 29 | lib-noranlib: $(alltypes-$(lib)) |
5f0e6fc7 RM |
30 | ifeq (yes,$(build-shared)) |
31 | lib-noranlib: $(objpfx)$(lib).so$($(lib).so-version) | |
32 | endif | |
e97ec51d RM |
33 | else |
34 | others: $(alltypes-$(lib)) | |
35 | endif | |
693e7b96 | 36 | |
d06b536d RM |
37 | # The linked shared library is never a dependent of lib-noranlib, |
38 | # because linking it will depend on libc.so already being built. | |
39 | ifneq (,$(filter .so,$(object-suffixes-$(lib)))) | |
40 | others: $(objpfx)$(lib).so | |
41 | endif | |
42 | ||
43 | ||
693e7b96 RM |
44 | # Use o-iterator.mk to generate a rule for each flavor of library. |
45 | define o-iterator-doit | |
64166d98 | 46 | $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ |
693e7b96 RM |
47 | $($(lib)-routines:%=$(objpfx)%$o); $$(build-extra-lib) |
48 | endef | |
193ce8dc | 49 | object-suffixes-left = $(object-suffixes-$(lib)) |
11872325 | 50 | include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib))) |
a13dab1c RM |
51 | |
52 | endif |