diff options
author | Miles Bader <miles@gnu.org> | 1995-08-25 14:25:07 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-08-25 14:25:07 +0000 |
commit | 9413796b1df2a93d8297a224315a7687abaee749 (patch) | |
tree | cabe571092e474276b970e66d586e520b0ccde30 /Makeconf | |
parent | d742afca0ce88b31016cc835a50ae029d654feaf (diff) |
($(libname).so): Use the linker -soname option to specify what library name
should be recorded by users.
(__libext, __libext-static, _libext): New variables.
($(target): %): Link against the absolute library with the appropiate
extension do determine whether shared or not, instead of using -L...-l
syntax.
Diffstat (limited to 'Makeconf')
-rw-r--r-- | Makeconf | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -143,8 +143,14 @@ else _objs = $(OBJS) endif +# Determine which sort of library we should link against from whether -static +# is used in LDFLAGS. +__libext=.so +__libext-static=.a +_libext=$(__libext$(findstring -static,$(LDFLAGS) $($@-LDFLAGS))) + $(target): %: $(_objs) $(OTHERLIBS) - $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),-Wl,-L$(dir $(lib)) $(patsubst lib%,-l%,$(notdir $(basename $(lib))))) '-Wl,-)' + $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),$(basename $(lib))$(_libext)) '-Wl,-)' ifeq ($(makemode),library) $(libname).a: $(OBJS) @@ -153,7 +159,7 @@ $(libname).a: $(OBJS) $(RANLIB) $@ $(libname).so: $(patsubst %.o,%_pic.o,$(OBJS)) - $(CC) -shared $(CFLAGS) -o $(libname).so $+ + $(CC) -shared $(CFLAGS) -Wl,-soname=$(libname) -o $(libname).so $+ endif # Making a snapshot |