diff options
-rw-r--r-- | share/mk/bsd.lib.mk | 39 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 12 | ||||
-rw-r--r-- | share/mk/sys.mk | 5 |
3 files changed, 53 insertions, 3 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 648de6a..0d3cbbc 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: bsd.lib.mk,v 1.59 1997/06/21 15:40:32 jkh Exp $ +# $Id: bsd.lib.mk,v 1.60 1997/08/05 03:49:48 asami Exp $ # .if exists(${.CURDIR}/../Makefile.inc) @@ -8,8 +8,10 @@ .if exists(${.CURDIR}/shlib_version) SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major +.if ${BINFORMAT} == aout SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor .endif +.endif .if defined(DESTDIR) CFLAGS+= -I${DESTDIR}/usr/include @@ -113,9 +115,15 @@ _LIBS=lib${LIB}.a .endif .if !defined(NOPIC) +.if ${BINFORMAT} == aout .if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) _LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} .endif +.else +.if defined(SHLIB_MAJOR) +_LIBS+=lib${LIB}.so.${SHLIB_MAJOR} +.endif +.endif .if defined(INSTALL_PIC_ARCHIVE) _LIBS+=lib${LIB}_pic.a .endif @@ -150,12 +158,23 @@ LDDESTDIRENV?= LIBRARY_PATH=${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib .if !defined(NOPIC) SOBJS+= ${OBJS:.o=.so} + +.if ${BINFORMAT} == aout lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOBJS} @${ECHO} building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} @${LDDESTDIRENV} ${CC} -shared -Wl,-x -Wl,-assert -Wl,pure-text \ -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ `lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD} +.else +lib${LIB}.so.${SHLIB_MAJOR}: ${SOBJS} + @${ECHO} building shared ${LIB} library \(version ${SHLIB_MAJOR}\) + @rm -f lib${LIB}.so.${SHLIB_MAJOR} + @${LDDESTDIRENV} ${CC} -shared -Wl,-x \ + -o lib${LIB}.so.${SHLIB_MAJOR} \ + -Wl,-soname,lib${LIB}.so.${SHLIB_MAJOR} \ + `lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD} +.endif lib${LIB}_pic.a:: ${SOBJS} @${ECHO} building special pic ${LIB} library @@ -188,9 +207,16 @@ _EXTRADEPEND:: .endif .if !defined(NOEXTRADEPEND) _EXTRADEPEND:: +.if ${BINFORMAT} == aout echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \ `${LDDESTDIRENV} ${CC} -shared -Wl,-f ${LDDESTDIR} ${LDADD}` \ >> ${DEPENDFILE} +.else +.if defined(DPADD) && ${DPADD} != "" + echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \ + ${DPADD} >> ${DEPENDFILE} +.endif +.endif .endif .if !target(install) @@ -212,12 +238,23 @@ realinstall: beforeinstall .endif .endif .if !defined(NOPIC) +.if ${BINFORMAT} == aout .if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${INSTALLFLAGS} ${SHLINSTALLFLAGS} \ lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ ${DESTDIR}${SHLIBDIR} .endif +.else +.if defined(SHLIB_MAJOR) + ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALLFLAGS} ${SHLINSTALLFLAGS} \ + lib${LIB}.so.${SHLIB_MAJOR} \ + ${DESTDIR}${SHLIBDIR} + ln ${LN_FLAGS} -sf lib${LIB}.so.${SHLIB_MAJOR} \ + ${DESTDIR}${SHLIBDIR}/lib${LIB}.so +.endif +.endif .if defined(INSTALL_PIC_ARCHIVE) ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR} diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index febc393..805ab54 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.prog.mk,v 1.53 1997/07/31 06:12:04 asami Exp $ +# $Id: bsd.prog.mk,v 1.54 1997/08/05 03:49:49 asami Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" @@ -65,8 +65,14 @@ clean: _SUBDIR .if defined(PROG) && !defined(NOEXTRADEPEND) _EXTRADEPEND: +.if ${BINFORMAT} == aout echo ${PROG}: `${CC} -Wl,-f ${CFLAGS} ${LDFLAGS} ${LDDESTDIR} \ ${LDADD:S/^/-Wl,/}` >> ${DEPENDFILE} +.else +.if defined(DPADD) && ${DPADD} != "" + echo ${PROG}: ${DPADD} >> ${DEPENDFILE} +.endif +.endif .endif .if !target(install) @@ -140,5 +146,9 @@ maninstall: all-man: .endif +.if ${BINFORMAT} != aout +.include <bsd.libnames.mk> +.endif + .include <bsd.dep.mk> .include <bsd.obj.mk> diff --git a/share/mk/sys.mk b/share/mk/sys.mk index f67177f..bd145c1 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -1,5 +1,5 @@ # from: @(#)sys.mk 8.2 (Berkeley) 3/21/94 -# $Id: sys.mk,v 1.22 1997/02/22 13:56:15 peter Exp $ +# $Id: sys.mk,v 1.23 1997/04/13 06:44:25 jkh Exp $ unix ?= We run FreeBSD, not UNIX. @@ -98,6 +98,9 @@ YFLAGS ?= -d GTAGSFLAGS= -se HTAGSFLAGS= +# Binary file format +BINFORMAT?= aout + .if defined(%POSIX) # Posix 1003.2 mandated rules # |