[BACK]Return to bsd.lib.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/share/mk/bsd.lib.mk between version 1.85 and 1.86

version 1.85, 1997/03/14 00:52:50 version 1.86, 1997/03/15 11:35:04
Line 19  SHLIB_MINOR != . ${.CURDIR}/shlib_versio
Line 19  SHLIB_MINOR != . ${.CURDIR}/shlib_versio
 .SUFFIXES:  .SUFFIXES:
 .SUFFIXES: .out .o .po .so .S .s .c .cc .C .f .y .l .ln .m4  .SUFFIXES: .out .o .po .so .S .s .c .cc .C .f .y .l .ln .m4
   
   
   # Set PICFLAGS to cc flags for producing position-independent code,
   # if not already set.  Includes -DPIC, if required.
   
   # Data-driven table using make variables to control  how shared libraries
   # are built for different platforms and object formats.
   # SHLIB_TYPE:           currently either "ELF" or "a.out".
   # SHLIB_SOVERSION:      version number to be compiled into a shared library
   #                       via -soname. Usualy ${SHLIB_MAJOR} on ELF.
   #                       NetBSD/pmax used to use ${SHLIB_MAJOR}.{SHLIB-MINOR}.
   # SHLIB_LDSTARTFILE:    ???
   # SHLIB_LDENDTILE:      ??
   # CPICFLAGS:    flags to compile .c files for .so objects.
   # APICFLAGS:    flags to assemble .S files for .so objects.
   
   .if (${MACHINE_ARCH} == "alpha")
   
   SHLIB_TYPE=ELF
   SHLIB_LDSTARTFILE= ${DESTDIR}/usr/lib/crtbeginS.o
   SHLIB_LDENDFILE= ${DESTDIR}/usr/lib/crtendS.o
   SHLIB_SOVERSION=${SHLIB_MAJOR}
   CPICFLAGS ?= -fpic -DPIC
   APICFLAGS ?= -DPIC
   
   .elif (${MACHINE_ARCH} == "mips")
   
   SHLIB_TYPE=ELF
   # still use gnu-derived ld.so on pmax; don't have or need lib<>.so support.
   SHLIB_LDSTARTFILE=
   SHLIB_LDENDFILE=
   SHLIB_SOVERSION=${SHLIB_MAJOR}
   
   # On mips, all libs need to be compiled with ABIcalls, not just sharedlibs.
   CPICFLAGS?=
   APICFLAGS?=
   #CPICFLAGS?= -fpic -DPIC
   #APICFLAGS?= -DPIC
   
   # so turn shlib PIC flags on for ${CPP}, ${CC}, and ${AS} as follows:
   AINC+=-DPIC -DABICALLS
   COPTS+= -fPIC ${AINC}
   AFLAGS+= -fPIC
   AS+=    -KPIC
   
   .else
   
   SHLIB_TYPE=a.out
   SHLIB_SOVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
   CPICFLAGS?= -fpic -DPIC
   APICFLAGS?= -fpic -DPIC
   
   .endif
   
   
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
   
 .c.o:  .c.o:
Line 34  CFLAGS+= ${COPTS}
Line 88  CFLAGS+= ${COPTS}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
   
 .c.so:  .c.so:
         @echo ${COMPILE.c:Q} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
         @${LD} -x -r ${.TARGET}.o -o ${.TARGET}          @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
   
Line 55  CFLAGS+= ${COPTS}
Line 109  CFLAGS+= ${COPTS}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
   
 .cc.so .C.so:  .cc.so .C.so:
         @echo ${COMPILE.cc:Q} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
         @${LD} -x -r ${.TARGET}.o -o ${.TARGET}          @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
   
Line 73  CFLAGS+= ${COPTS}
Line 127  CFLAGS+= ${COPTS}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
   
 .S.so .s.so:  .S.so .s.so:
         @echo ${COMPILE.S:Q} ${PICFLAG} -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.S:Q} ${APICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.S} ${PICFLAG} -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.S} ${APICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
         @${LD} -x -r ${.TARGET}.o -o ${.TARGET}          @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
   
 .if !defined(PICFLAG)  
 PICFLAG=-fpic  
 .endif  
   
 .if !defined(NOPROFILE)  .if !defined(NOPROFILE)
 _LIBS=lib${LIB}.a lib${LIB}_p.a  _LIBS=lib${LIB}.a lib${LIB}_p.a
Line 126  lib${LIB}_pic.a:: ${SOBJS}
Line 177  lib${LIB}_pic.a:: ${SOBJS}
 lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a ${DPADD}  lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a ${DPADD}
         @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)          @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
         @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}          @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
 .if (${MACHINE_ARCH} != "alpha")  .if (${SHLIB_TYPE} == "a.out")
         $(LD) -x -Bshareable -Bforcearchive \          $(LD) -x -Bshareable -Bforcearchive \
             -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}_pic.a ${LDADD}              -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}_pic.a ${LDADD}
 .else  .elif (${SHLIB_TYPE} == "ELF")
         $(LD) -shared -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \          $(LD) -x -shared -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
             -soname lib${LIB}.so.${SHLIB_MAJOR} \              -soname lib${LIB}.so.${SHLIB_SOVERSION}  ${SHLIB_LDSTARTFILE} \
             ${DESTDIR}/usr/lib/crtbeginS.o \  
             --whole-archive lib${LIB}_pic.a --no-whole-archive ${LDADD} \              --whole-archive lib${LIB}_pic.a --no-whole-archive ${LDADD} \
             ${DESTDIR}/usr/lib/crtendS.o              ${SHLIB_LDENDFILE}
 .endif  .endif
   
 LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}  LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
Line 194  realinstall:
Line 244  realinstall:
 .if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)  .if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
         ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \          ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
             lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR}              lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR}
 .if (${MACHINE_ARCH} == "alpha")  .if (${SHLIB_TYPE} == "ELF")
         rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}          rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
         ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \          ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
             ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}              ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}

Legend:
Removed from v.1.85  
changed lines
  Added in v.1.86

CVSweb <webmaster@jp.NetBSD.org>