Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/share/mk/bsd.lib.mk,v rcsdiff: /ftp/cvs/cvsroot/src/share/mk/bsd.lib.mk,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.27 retrieving revision 1.40 diff -u -p -r1.27 -r1.40 --- src/share/mk/bsd.lib.mk 1993/09/29 01:02:21 1.27 +++ src/share/mk/bsd.lib.mk 1993/12/04 01:28:39 1.40 @@ -1,16 +1,21 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $Id: bsd.lib.mk,v 1.27 1993/09/29 01:02:21 pk Exp $ +# $Id: bsd.lib.mk,v 1.40 1993/12/04 01:28:39 cgd Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif +.if exists(${.CURDIR}/shlib_version) +SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major +SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor +.endif + .MAIN: all -# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries +# prefer .S to a .c, add .po, remove stuff not used in the BSD libraries # .so used for PIC object files .SUFFIXES: -.SUFFIXES: .out .o .po .so .s .c .cc .C .f .y .l .0 .1 .2 .3 .4 .5 .6 .7 .8 +.SUFFIXES: .out .o .po .so .S .s .c .cc .C .f .y .l .0 .1 .2 .3 .4 .5 .6 .7 .8 .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} @@ -35,19 +40,22 @@ @${LD} -X -r ${.TARGET} @mv a.out ${.TARGET} -.s.o: +.cc.so .C.so: + ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +.S.o .s.o: ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} -o ${.TARGET} @${LD} -x -r ${.TARGET} @mv a.out ${.TARGET} -.s.po: +.S.po .s.po: ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} -o ${.TARGET} @${LD} -X -r ${.TARGET} @mv a.out ${.TARGET} -.s.so: +.S.so .s.so: ${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} -k -o ${.TARGET} @@ -59,6 +67,9 @@ _LIBS=lib${LIB}.a .if !defined(NOPIC) _LIBS+=lib${LIB}_pic.a +.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) +_LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +.endif .endif .if !defined(PICFLAG) @@ -89,6 +100,12 @@ lib${LIB}_pic.a:: ${SOBJS} @${AR} cTq lib${LIB}_pic.a `lorder ${SOBJS} | tsort` ${LDADD} ${RANLIB} lib${LIB}_pic.a +lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a + @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) + @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} + $(LD) -Bshareable -Bforcearchive \ + -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}_pic.a + llib-l${LIB}.ln: ${SRCS} ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c} @@ -98,7 +115,8 @@ clean: rm -f ${OBJS} rm -f ${POBJS} profiled/*.o rm -f ${SOBJS} shared/*.o - rm -f lib${LIB}.a lib${LIB}_p.a llib-l${LIB}.ln + rm -f lib${LIB}.a lib${LIB}_p.a lib${LIB}_pic.a llib-l${LIB}.ln + rm -f lib${LIB}.so.*.* .endif cleandir: clean @@ -106,7 +124,7 @@ cleandir: clean .if defined(SRCS) afterdepend: @(TMP=/tmp/_depend$$$$; \ - sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po:/' < .depend > $$TMP; \ + sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < .depend > $$TMP; \ mv $$TMP .depend) .endif @@ -127,6 +145,16 @@ realinstall: lib${LIB}_p.a ${DESTDIR}${LIBDIR} ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a .endif +.if !defined(NOPIC) +# ranlib lib${LIB}_pic.a + install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + lib${LIB}_pic.a ${DESTDIR}${LIBDIR} + ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a +.endif +.if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) + install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR} +.endif # install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ # llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR} .if defined(LINKS) && !empty(LINKS)