]> sourceware.org Git - glibc.git/blame - extra-lib.mk
Tue Oct 24 15:22:58 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
[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
6# to be included in that library.
7
8lib := $(firstword $(extra-libs-left))
9extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
10
193ce8dc
RM
11object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
12
6aa8372e
RM
13# Make sure these are simply-expanded variables before we append to them,
14# since we want the expressions we we append to be expanded right now.
15install-lib := $(install-lib)
16extra-objs := $(extra-objs)
17
693e7b96 18# Add each flavor of library to the lists of things to build and install.
193ce8dc
RM
19install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
20extra-objs += $(foreach o,$(object-suffixes-$(lib)),$($(lib)-routines:=$o))
6aa8372e
RM
21alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
22 $(objpfx)$(patsubst %,$(libtype$o),\
23 $(lib:lib%=%)))
193ce8dc 24ifneq (,$(filter .so,$(object-suffixes-$(lib))))
693e7b96
RM
25alltypes-$(lib) += $(objpfx)$(lib).so
26endif
27
28lib-noranlib: $(alltypes-$(lib))
29
30# Use o-iterator.mk to generate a rule for each flavor of library.
31define o-iterator-doit
32$(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
33 $($(lib)-routines:%=$(objpfx)%$o); $$(build-extra-lib)
34endef
193ce8dc 35object-suffixes-left = $(object-suffixes-$(lib))
11872325 36include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib)))
This page took 0.033491 seconds and 5 git commands to generate.