Thu May 9 01:24:00 1996 Ulrich Drepper <drepper@cygnus.com>
[glibc/history.git] / extra-lib.mk
blobf6a1c83e37b14a76afbbb18c3037b8afbc8f605a
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.
8 lib := $(firstword $(extra-libs-left))
9 extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
11 object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
13 # Make sure these are simply-expanded variables before we append to them,
14 # since we want the expressions we append to be expanded right now.
15 install-lib := $(install-lib)
16 extra-objs := $(extra-objs)
18 # Add each flavor of library to the lists of things to build and install.
19 install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
20 extra-objs += $(foreach o,$(object-suffixes-$(lib)),$($(lib)-routines:=$o))
21 alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
22 $(common-objpfx)$(patsubst %,$(libtype$o),\
23 $(lib:lib%=%)))
24 ifneq (,$(filter .so,$(object-suffixes-$(lib))))
25 alltypes-$(lib) += $(common-objpfx)$(lib).so
26 endif
28 ifeq (,$($(lib)-no-lib-dep))
29 lib-noranlib: $(alltypes-$(lib))
30 else
31 others: $(alltypes-$(lib))
32 endif
34 # Use o-iterator.mk to generate a rule for each flavor of library.
35 define o-iterator-doit
36 $(common-objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
37 $($(lib)-routines:%=$(objpfx)%$o); $$(build-extra-lib)
38 endef
39 object-suffixes-left = $(object-suffixes-$(lib))
40 include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib)))