summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-09-01 17:44:24 +0000
committerMiles Bader <miles@gnu.org>1995-09-01 17:44:24 +0000
commitdbbb2627f40dc1d13e5a762ad963bfab0d606917 (patch)
tree8c90314a38b6fbf0c5547dabc8db0ab2e0a3df45
parent6619797c248578ea5737bb95651d42d06f39e060 (diff)
(libsubst, libsubst-override, _libsubst): New vars.
($(target): %): Replace each library reference with $(_libsubst). (libthreads-libsubst): New variable. [$(makemode)==library] (targets): Default to both .a and .so libraries. [$(makemode)==library] (all, install): Make and install $(targets) instead of the explicit default list of them. [$(makemode)==library] (libs): New target. (../%.a ../%.so): Make the `libs' target instead of an explicit list of libraries.
-rw-r--r--Makeconf18
1 files changed, 14 insertions, 4 deletions
diff --git a/Makeconf b/Makeconf
index 454f7b32..a844330b 100644
--- a/Makeconf
+++ b/Makeconf
@@ -43,6 +43,8 @@ libdir := $(exec_prefix)/lib
infodir := $(prefix)/info
includedir := $(prefix)/include
+libthreads-libsubst=../libthreads/libthreads.a
+
# END CONFIGURATION AREA
@@ -83,6 +85,9 @@ ifeq ($(makemode),library)
ifndef installhdrsubdir
installhdrsubdir = hurd
endif
+ ifndef targets
+ targets = $(libname).a $(libname).so
+ endif
endif
@@ -116,8 +121,9 @@ $(addprefix $(installationdir)/,$(targets)): $(installationdir)/%: %
endif
ifeq ($(makemode),library)
-all: $(libname).a $(libname).so
-install: $(libdir)/$(libname).a $(libdir)/$(libname).so $(addprefix $(includedir)/$(installhdrsubdir)/,$(installhdrs))
+all: libs
+libs: $(targets)
+install: $(addprefix $(libdir)/,$(targets)) $(addprefix $(includedir)/$(installhdrsubdir)/,$(installhdrs))
$(libdir)/$(libname).a: $(libname).a
$(INSTALL_DATA) $(libname).a $(libdir)/$(libname).a
@@ -149,8 +155,12 @@ __libext=.so
__libext-static=.a
_libext=$(__libext$(findstring -static,$(LDFLAGS) $($@-LDFLAGS)))
+libsubst=$(basename ${lib})$(_libext)
+libsubst-override=${$(notdir $(basename ${lib}))-libsubst}
+_libsubst=${libsubst$(patsubst %,-override,${libsubst-override})}
+
$(target): %: $(_objs) $(OTHERLIBS)
- $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),$(basename $(lib))$(_libext)) '-Wl,-)'
+ $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),${_libsubst}) '-Wl,-)'
ifeq ($(makemode),library)
$(libname).a: $(OBJS)
@@ -201,7 +211,7 @@ relink:
# built if either is, because it will use the appropriate one even if the other
# is specified in someone's dependency list.
../%.a ../%.so: FORCE
- $(MAKE) -C $(dir $@) $(notdir $(@:.so=.a)) $(notdir $(@:.a=.so))
+ $(MAKE) -C $(dir $@) libs
# Default rule to build PIC object files.
%_pic.o: %.c