]> sourceware.org Git - glibc.git/blame_incremental - extra-lib.mk
Update.
[glibc.git] / extra-lib.mk
... / ...
CommitLineData
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
11object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
12
13ifneq (,$(object-suffixes-$(lib)))
14
15# Make sure these are simply-expanded variables before we append to them,
16# since we want the expressions we append to be expanded right now.
17install-lib := $(install-lib)
18extra-objs := $(extra-objs)
19
20# Add each flavor of library to the lists of things to build and install.
21install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
22extra-objs += $(foreach o,$(object-suffixes-$(lib)),\
23 $(patsubst %,%$o,$($(lib)-routines)))
24alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
25 $(objpfx)$(patsubst %,$(libtype$o),\
26 $(lib:lib%=%)))
27
28ifeq (,$(filter $(lib),$(extra-libs-others)))
29lib-noranlib: $(alltypes-$(lib))
30ifeq (yes,$(build-shared))
31lib-noranlib: $(objpfx)$(lib).so$($(lib).so-version)
32endif
33else
34others: $(alltypes-$(lib))
35endif
36
37# The linked shared library is never a dependent of lib-noranlib,
38# because linking it will depend on libc.so already being built.
39ifneq (,$(filter .os,$(object-suffixes-$(lib))))
40others: $(objpfx)$(lib).so$($(lib).so-version)
41endif
42
43
44# Use o-iterator.mk to generate a rule for each flavor of library.
45define o-iterator-doit
46$(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
47 $($(lib)-routines:%=$(objpfx)%$o); $$(build-extra-lib)
48endef
49object-suffixes-left = $(object-suffixes-$(lib))
50include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib)))
51
52# Add the version script to the dependencies of the shared library.
53$(objpfx)$(lib).so: $(firstword $(wildcard $($(lib)-map) $(lib).map $(..)$(lib).map))
54
55endif
This page took 0.030687 seconds and 5 git commands to generate.