diff options
author | Roland McGrath <roland@gnu.org> | 1995-10-11 03:31:18 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-10-11 03:31:18 +0000 |
commit | efb25c01a56ed71c3cc4d699e1eadcf6aa27f8b5 (patch) | |
tree | f0c3bfa77c23f3ca9a2eed2b4e8be0fcc6cb50ca | |
parent | e0455278de43f40c946268c10fa3e30168216091 (diff) |
(rpath): New variable.
($(target)): Use it in link command.
($(libname).so): Likewise.
Use $^ instead of $+.
-rw-r--r-- | Makeconf | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -159,8 +159,15 @@ libsubst=$(basename ${lib})$(_libext) libsubst-override=${$(notdir $(basename ${lib}))-libsubst} _libsubst=${libsubst$(patsubst %,-override,${libsubst-override})} +# Direct the linker where to find shared objects specified in the +# dependencies of other shared objects it encounters. +rpath := -Wl,-rpath-link=.:$(subst $. ,:,$(dir $(wildcard ../lib*/lib*.so))) + $(target): %: $(_objs) $(OTHERLIBS) - $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),${_libsubst}) '-Wl,-)' + $(CC) $(rpath) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ \ + '-Wl,-(' $(filter %.o,$^) \ + $(foreach lib,$(filter-out %.o,$+),${_libsubst}) \ + '-Wl,-)' ifeq ($(makemode),library) $(libname).a: $(OBJS) @@ -170,7 +177,7 @@ $(libname).a: $(OBJS) $(libname).so: $(patsubst %.o,%_pic.o,$(OBJS)) $(CC) -shared -Wl,-soname=$(libname).so -o $(libname).so \ - $(CFLAGS) $(LDFLAGS) $($@-LDFLAGS) $+ + $(rpath) $(CFLAGS) $(LDFLAGS) $($@-LDFLAGS) $^ endif # Making a snapshot |