1995-03-17 18:42:51 +00:00
|
|
|
# This file is included several times in a row, once
|
|
|
|
|
# for each element of $(extra-libs). $(extra-libs-left)
|
|
|
|
|
# is initialized first to $(extra-libs) so that with each
|
|
|
|
|
# inclusion, we advance $(lib) to the next library name (e.g. libfoo).
|
|
|
|
|
# The variable $($(lib)-routines) defines the list of modules
|
1999-07-20 08:19:37 +00:00
|
|
|
# to be included in that library. A sysdep Makefile can add to
|
|
|
|
|
# $(lib)-sysdep_routines to include additional modules.
|
1995-03-17 18:42:51 +00:00
|
|
|
|
2002-10-16 22:09:55 +00:00
|
|
|
lib := $(firstword $(extra-libs-left))
|
1995-03-17 18:42:51 +00:00
|
|
|
extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
|
|
|
|
|
|
1995-04-01 09:07:31 +00:00
|
|
|
object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
|
|
|
|
|
|
1996-05-13 22:11:28 +00:00
|
|
|
ifneq (,$(object-suffixes-$(lib)))
|
|
|
|
|
|
1995-04-08 19:23:00 +00:00
|
|
|
# Make sure these are simply-expanded variables before we append to them,
|
1995-10-24 21:45:10 +00:00
|
|
|
# since we want the expressions we append to be expanded right now.
|
1995-04-08 19:23:00 +00:00
|
|
|
install-lib := $(install-lib)
|
|
|
|
|
extra-objs := $(extra-objs)
|
|
|
|
|
|
1999-07-20 08:19:37 +00:00
|
|
|
# The modules that go in $(lib).
|
|
|
|
|
all-$(lib)-routines := $($(lib)-routines) $($(lib)-sysdep_routines)
|
|
|
|
|
|
1995-03-17 18:42:51 +00:00
|
|
|
# Add each flavor of library to the lists of things to build and install.
|
1995-04-01 09:07:31 +00:00
|
|
|
install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
|
1998-11-08 10:40:28 +00:00
|
|
|
extra-objs += $(foreach o,$(object-suffixes-$(lib):.os=),\
|
|
|
|
|
$(patsubst %,%$o,$(filter-out \
|
|
|
|
|
$($(lib)-shared-only-routines),\
|
1999-07-20 08:19:37 +00:00
|
|
|
$(all-$(lib)-routines))))
|
1998-11-08 10:40:28 +00:00
|
|
|
ifneq (,$(filter .os,$(object-suffixes-$(lib))))
|
1999-07-20 08:19:37 +00:00
|
|
|
extra-objs += $(all-$(lib)-routines:%=%.os)
|
1998-11-08 10:40:28 +00:00
|
|
|
endif
|
1995-04-08 19:23:00 +00:00
|
|
|
alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
|
1996-05-14 20:30:25 +00:00
|
|
|
$(objpfx)$(patsubst %,$(libtype$o),\
|
1995-04-08 19:23:00 +00:00
|
|
|
$(lib:lib%=%)))
|
1995-03-17 18:42:51 +00:00
|
|
|
|
1996-07-05 23:47:08 +00:00
|
|
|
ifeq (,$(filter $(lib),$(extra-libs-others)))
|
1995-03-17 18:42:51 +00:00
|
|
|
lib-noranlib: $(alltypes-$(lib))
|
1996-06-25 08:56:57 +00:00
|
|
|
ifeq (yes,$(build-shared))
|
1996-09-07 04:10:57 +00:00
|
|
|
lib-noranlib: $(objpfx)$(lib).so$($(lib).so-version)
|
1996-06-25 08:56:57 +00:00
|
|
|
endif
|
1995-10-24 21:45:10 +00:00
|
|
|
else
|
|
|
|
|
others: $(alltypes-$(lib))
|
|
|
|
|
endif
|
1995-03-17 18:42:51 +00:00
|
|
|
|
1996-05-29 05:09:31 +00:00
|
|
|
# The linked shared library is never a dependent of lib-noranlib,
|
|
|
|
|
# because linking it will depend on libc.so already being built.
|
1997-08-20 03:53:21 +00:00
|
|
|
ifneq (,$(filter .os,$(object-suffixes-$(lib))))
|
1997-06-19 19:11:22 +00:00
|
|
|
others: $(objpfx)$(lib).so$($(lib).so-version)
|
1996-05-29 05:09:31 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
1995-03-17 18:42:51 +00:00
|
|
|
# Use o-iterator.mk to generate a rule for each flavor of library.
|
1998-11-10 19:11:20 +00:00
|
|
|
ifneq (,$(filter-out .os,$(object-suffixes-$(lib))))
|
1995-03-17 18:42:51 +00:00
|
|
|
define o-iterator-doit
|
1996-05-14 20:30:25 +00:00
|
|
|
$(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
|
1998-11-08 10:40:28 +00:00
|
|
|
$(patsubst %,$(objpfx)%$o,\
|
|
|
|
|
$(filter-out $($(lib)-shared-only-routines),\
|
1999-07-20 08:19:37 +00:00
|
|
|
$(all-$(lib)-routines))); \
|
1998-11-08 10:40:28 +00:00
|
|
|
$$(build-extra-lib)
|
1995-03-17 18:42:51 +00:00
|
|
|
endef
|
1998-11-08 10:40:28 +00:00
|
|
|
object-suffixes-left = $(object-suffixes-$(lib):.os=)
|
|
|
|
|
include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib):.os=))
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifneq (,$(filter .os,$(object-suffixes-$(lib))))
|
|
|
|
|
$(objpfx)$(patsubst %,$(libtype.os),$(lib:lib%=%)): \
|
1999-07-20 08:19:37 +00:00
|
|
|
$(all-$(lib)-routines:%=$(objpfx)%.os)
|
1998-11-08 10:40:28 +00:00
|
|
|
$(build-extra-lib)
|
|
|
|
|
endif
|
1996-05-13 22:11:28 +00:00
|
|
|
|
1998-07-20 17:25:48 +00:00
|
|
|
ifeq ($(versioning),yes)
|
1997-07-12 23:35:19 +00:00
|
|
|
# Add the version script to the dependencies of the shared library.
|
1998-07-20 17:25:48 +00:00
|
|
|
$(objpfx)$(lib).so: $(firstword $($(lib)-map) \
|
|
|
|
|
$(addprefix $(common-objpfx), \
|
|
|
|
|
$(filter $(lib).map, \
|
|
|
|
|
$(version-maps))))
|
|
|
|
|
endif
|
1997-07-12 23:35:19 +00:00
|
|
|
|
1996-05-13 22:11:28 +00:00
|
|
|
endif
|
2002-04-08 08:59:00 +00:00
|
|
|
|
2002-10-16 22:09:55 +00:00
|
|
|
# This will define `libof-ROUTINE := LIB' for each of the routines.
|
|
|
|
|
cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines)
|
|
|
|
|
ifneq (,$(cpp-srcs-left))
|
|
|
|
|
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
|
2002-04-08 08:59:00 +00:00
|
|
|
endif
|
2002-10-16 22:09:55 +00:00
|
|
|
|
|
|
|
|
CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
|