From b531e6bb86952d3985923b1181488c61fd5f03cc Mon Sep 17 00:00:00 2001 From: bde Date: Wed, 9 Apr 1997 16:10:27 +0000 Subject: Use `ld -f' (actually `cc -Wl,-f') at `make depend' time to generate almost perfect dependencies on crt0's and libraries. DPADD and bsd.libnames.mk should go away soon. Use a new _EXTRADEPEND target to implement this and to avoid editing of .depend when .depend isn;t being rebuilt. The afterdepend target doesn't seem to be good for anything and is now unused. Fixed LDDESTDIR for the DESTDIR case when ${SHLIBDIR} != /usr/lib. Added commented-out -nostdlib to LDDESTDIR for the DESTDIR case. The wrong libraries may be used without this; however it breaks linkage to crt0 and libc. --- share/mk/bsd.lib.mk | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'share/mk/bsd.lib.mk') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 0a23ef0..66245fb 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $Id$ +# $Id: bsd.lib.mk,v 1.50 1997/02/22 13:56:11 peter Exp $ # .if exists(${.CURDIR}/../Makefile.inc) @@ -143,7 +143,8 @@ lib${LIB}_p.a:: ${POBJS} .endif .if defined(DESTDIR) -LDDESTDIR?= -L${DESTDIR}/usr/lib +LDDESTDIR?= -L${DESTDIR}${SHLIBDIR} -L${DESTDIR}/usr/lib +# LDDESTDIR+= -nostdlib .endif .if !defined(NOPIC) @@ -182,10 +183,16 @@ clean: _SUBDIR .endif .if defined(SRCS) -afterdepend: - @(TMP=_depend$$$$; \ - sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < .depend > $$TMP; \ - mv $$TMP .depend) +_EXTRADEPEND:: + @TMP=_depend$$$$; \ + sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < ${DEPENDFILE} \ + > $$TMP; \ + mv $$TMP ${DEPENDFILE} +.endif +.if defined(LDADD) +_EXTRADEPEND:: + echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \ + `ld -Bshareable -x -f ${LDDESTDIR} ${LDADD}` >> ${DEPENDFILE} .endif .if !target(install) -- cgit v1.1