1995-03-18 02:42:51 +08: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
|
|
|
|
# to be included in that library.
|
|
|
|
|
|
|
|
lib := $(firstword $(extra-libs-left))
|
|
|
|
extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
|
|
|
|
|
1995-04-01 17:07:31 +08:00
|
|
|
object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
|
|
|
|
|
1995-04-09 03:23:00 +08:00
|
|
|
# Make sure these are simply-expanded variables before we append to them,
|
1995-10-25 05:45:10 +08:00
|
|
|
# since we want the expressions we append to be expanded right now.
|
1995-04-09 03:23:00 +08:00
|
|
|
install-lib := $(install-lib)
|
|
|
|
extra-objs := $(extra-objs)
|
|
|
|
|
1995-03-18 02:42:51 +08:00
|
|
|
# Add each flavor of library to the lists of things to build and install.
|
1995-04-01 17:07:31 +08:00
|
|
|
install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
|
|
|
|
extra-objs += $(foreach o,$(object-suffixes-$(lib)),$($(lib)-routines:=$o))
|
1995-04-09 03:23:00 +08:00
|
|
|
alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
|
|
|
|
$(objpfx)$(patsubst %,$(libtype$o),\
|
|
|
|
$(lib:lib%=%)))
|
1995-04-01 17:07:31 +08:00
|
|
|
ifneq (,$(filter .so,$(object-suffixes-$(lib))))
|
1995-03-18 02:42:51 +08:00
|
|
|
alltypes-$(lib) += $(objpfx)$(lib).so
|
|
|
|
endif
|
|
|
|
|
1995-10-31 14:54:40 +08:00
|
|
|
ifeq (,$($(lib)-no-lib-dep))
|
1995-03-18 02:42:51 +08:00
|
|
|
lib-noranlib: $(alltypes-$(lib))
|
1995-10-25 05:45:10 +08:00
|
|
|
else
|
|
|
|
others: $(alltypes-$(lib))
|
|
|
|
endif
|
1995-03-18 02:42:51 +08:00
|
|
|
|
|
|
|
# Use o-iterator.mk to generate a rule for each flavor of library.
|
|
|
|
define o-iterator-doit
|
|
|
|
$(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
|
|
|
|
$($(lib)-routines:%=$(objpfx)%$o); $$(build-extra-lib)
|
|
|
|
endef
|
1995-04-01 17:07:31 +08:00
|
|
|
object-suffixes-left = $(object-suffixes-$(lib))
|
1995-04-24 17:00:07 +08:00
|
|
|
include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib)))
|