[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.273 and 1.273.4.2

version 1.273, 2008/01/09 11:26:14 version 1.273.4.2, 2008/10/05 20:11:24
Line 7 
Line 7 
 # Pull in <bsd.sys.mk> here so we can override its .c.o rule  # Pull in <bsd.sys.mk> here so we can override its .c.o rule
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   
   LIBISMODULE?=   no
   LIBISPRIVATE?=  no
   
   _LIB_PREFIX=    lib
   
   .if ${LIBISMODULE} != "no"
   _LIB_PREFIX=    # empty
   MKDEBUGLIB:=    no
   MKLINT:=        no
   MKPICINSTALL:=  no
   MKPROFILE:=     no
   MKSTATICLIB:=   no
   .endif
   
   .if ${LIBISPRIVATE} != "no"
   MKDEBUGLIB:=    no
   MKLINT:=        no
   MKPIC:=         no
   MKPROFILE:=     no
   .endif
   
 ##### Basic targets  ##### Basic targets
 .PHONY:         checkver libinstall  .PHONY:         checkver libinstall
 realinstall:    checkver libinstall  realinstall:    checkver libinstall
Line 34  DPADD+=  ${LIBDO.${_lib}}/lib${_lib}.so
Line 55  DPADD+=  ${LIBDO.${_lib}}/lib${_lib}.so
 .endif                                                                  # }  .endif                                                                  # }
   
 ##### Build and install rules  ##### Build and install rules
 MKDEP_SUFFIXES?=        .o .po .so .ln  MKDEP_SUFFIXES?=        .o .po .so .go .ln
 CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}  CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
 CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}  CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
   
Line 165  MKSHLIBOBJS= no
Line 186  MKSHLIBOBJS= no
 # Platform-independent linker flags for ELF shared libraries  # Platform-independent linker flags for ELF shared libraries
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
 SHLIB_SOVERSION=        ${SHLIB_MAJOR}  SHLIB_SOVERSION=        ${SHLIB_MAJOR}
 SHLIB_SHFLAGS=          -Wl,-soname,lib${LIB}.so.${SHLIB_SOVERSION}  SHLIB_SHFLAGS=          -Wl,-soname,${_LIB_PREFIX}${LIB}.so.${SHLIB_SOVERSION}
 SHLIB_SHFLAGS+=         -Wl,--warn-shared-textrel  SHLIB_SHFLAGS+=         -Wl,--warn-shared-textrel
 SHLIB_LDSTARTFILE?=     ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGINS}  SHLIB_LDSTARTFILE?=     ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGINS}
 SHLIB_LDENDFILE?=       ${_GCC_CRTENDS} ${DESTDIR}/usr/lib/crtn.o  SHLIB_LDENDFILE?=       ${_GCC_CRTENDS} ${DESTDIR}/usr/lib/crtn.o
Line 333  OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
Line 354  OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
   
 STOBJS+=${OBJS}  STOBJS+=${OBJS}
   
 .if ${MKPRIVATELIB} != "no"  LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
   
   .if ${LIBISPRIVATE} != "no"
 # No installation is required  # No installation is required
 libinstall::  libinstall::
 .else   # ${MKPRIVATELIB} == "no"                                       # {  .else   # ${LIBISPRIVATE} == "no"                                       # {
   
 .if ${MKDEBUGLIB} != "no"  .if ${MKDEBUGLIB} != "no"
 _LIBS+=lib${LIB}_g.a  _LIBS+=lib${LIB}_g.a
Line 371  _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
Line 394  _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
 .endif  .endif
 .endif                                                                  # }  .endif                                                                  # }
   
 LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}  .if ${MKLINT} != "no" && !empty(LOBJS)
 .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)  
 _LIBS+=llib-l${LIB}.ln  _LIBS+=llib-l${LIB}.ln
 .endif  .endif
   
 .endif  # ${MKPRIVATELIB} == "no"                                       # }  .endif  # ${LIBISPRIVATE} == "no"                                       # }
   
 ALLOBJS=  ALLOBJS=
 .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \  .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
Line 384  ALLOBJS=
Line 406  ALLOBJS=
 ALLOBJS+=${STOBJS}  ALLOBJS+=${STOBJS}
 .endif  .endif
 ALLOBJS+=${POBJS} ${SOBJS}  ALLOBJS+=${POBJS} ${SOBJS}
 .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)  .if ${MKLINT} != "no" && !empty(LOBJS)
 ALLOBJS+=${LOBJS}  ALLOBJS+=${LOBJS}
 .endif  .endif
 .else   # !defined(LIB)                                                 # } {  .else   # !defined(LIB)                                                 # } {
Line 441  _LIBLDOPTS+= -Wl,-rpath-link,${DESTDIR}$
Line 463  _LIBLDOPTS+= -Wl,-rpath-link,${DESTDIR}$
                 -L${DESTDIR}${SHLIBINSTALLDIR}                  -L${DESTDIR}${SHLIBINSTALLDIR}
 .endif  .endif
   
 lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \  # gcc -shared now adds -lc automatically. For libraries other than libc and
   # libgcc* we add as a dependency the installed shared libc. For libc and
   # libgcc* we avoid adding libc as a dependency by using -nostdlib. Note that
   # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not
   # to add standard libraries, not the linker.
   .if !defined(LIB)
   DPLIBC ?= ${DESTDIR}${LIBC_SO}
   .else
   .if ${LIB} != "c" && ${LIB:Mgcc*} == ""
   DPLIBC ?= ${DESTDIR}${LIBC_SO}
   .else
   LDLIBC ?= -nodefaultlibs
   .if ${LIB} == "c"
   LDADD+= -lgcc_pic
   .endif
   .endif
   .endif
   
   lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} ${DPLIBC} \
     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}      ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
         ${_MKTARGET_BUILD}          ${_MKTARGET_BUILD}
         rm -f lib${LIB}.so.${SHLIB_FULLVERSION}          rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
 .if defined(DESTDIR)  .if defined(DESTDIR)
         ${CC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ \          ${CC} ${LDLIBC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ \
             ${_LIBLDOPTS} \              ${_LIBLDOPTS} \
             -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \              -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \
             -Wl,--whole-archive ${SOLIB} \              -Wl,--whole-archive ${SOLIB} \
             -Wl,--no-whole-archive ${LDADD} \              -Wl,--no-whole-archive ${LDADD} \
             -L${_GCC_LIBGCCDIR}              -L${_GCC_LIBGCCDIR}
 .else  .else
         ${CC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \          ${CC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} \
             ${_LIBLDOPTS} \              -o ${.TARGET} ${_LIBLDOPTS} \
             -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${LDADD}              -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${LDADD}
 .endif  .endif
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
 #  We don't use INSTALL_SYMLINK here because this is just  #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does  #  happening inside the build directory/objdir. XXX Why does
 #  this spend so much effort on libraries that aren't live??? XXX  #  this spend so much effort on libraries that aren't live??? XXX
   .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
       "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
         ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp          ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
         mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}          mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
   .endif
         ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp          ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
         mv -f lib${LIB}.so.tmp lib${LIB}.so          mv -f lib${LIB}.so.tmp lib${LIB}.so
 .endif  .endif
   .if ${MKSTRIPIDENT} != "no"
           ${OBJCOPY} -R .ident ${.TARGET}
   .endif
   
 .if !empty(LOBJS)                                                       # {  .if !empty(LOBJS)                                                       # {
 LLIBS?=         -lc  LLIBS?=         -lc
Line 479  llib-l${LIB}.ln: ${LOBJS}
Line 525  llib-l${LIB}.ln: ${LOBJS}
 .endif  .endif
 .endif                                                                  # }  .endif                                                                  # }
   
   lint: ${LOBJS}
   .if defined(LOBJS) && !empty(LOBJS)
           ${LINT} ${LINTFLAGS} ${LOBJS}
   .endif
   
 cleanlib: .PHONY  cleanlib: .PHONY
         rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}          rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
         rm -f lib${LIB}.a ${STOBJS}          rm -f lib${LIB}.a ${STOBJS}
Line 570  ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib
Line 621  ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib
 .endif  .endif
   
 .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)  .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
 libinstall:: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}  _LIB_SO_TGT=            ${DESTDIR}${_LIBSODIR}/${_LIB_PREFIX}${LIB}.so
 .PRECIOUS: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}  _LIB_SO_TGTLIBDIR=         ${DESTDIR}${LIBDIR}/${_LIB_PREFIX}${LIB}.so
   
   libinstall:: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
   .PRECIOUS: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
   
 .if ${MKUPDATE} == "no"  .if ${MKUPDATE} == "no"
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})  .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! .MADE  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! .MADE
 .endif  .endif
 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
 .else  .else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})  .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: .MADE
 .endif  .endif
 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
 .endif  .endif
         ${_MKTARGET_INSTALL}          ${_MKTARGET_INSTALL}
         ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \          ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
                 ${.ALLSRC} ${.TARGET}                  ${.ALLSRC} ${.TARGET}
 .if ${_LIBSODIR} != ${LIBDIR}  .if ${_LIBSODIR} != ${LIBDIR}
         ${INSTALL_SYMLINK} \          ${INSTALL_SYMLINK} -l r \
                 -l r ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \                  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                 ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}                  ${_LIB_SO_TGTLIBDIR}.${SHLIB_FULLVERSION}
 .endif  .endif
 .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)  .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
         /sbin/ldconfig -m ${_LIBSODIR} ${LIBDIR}          /sbin/ldconfig -m ${_LIBSODIR} ${LIBDIR}
 .endif  .endif
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
   .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
       "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
         ${INSTALL_SYMLINK} \          ${INSTALL_SYMLINK} \
                 lib${LIB}.so.${SHLIB_FULLVERSION} \                  ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
                 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_MAJOR}                  ${_LIB_SO_TGT}.${SHLIB_MAJOR}
 .if ${_LIBSODIR} != ${LIBDIR}  .if ${_LIBSODIR} != ${LIBDIR}
         ${INSTALL_SYMLINK} \          ${INSTALL_SYMLINK} -l r \
                 -l r ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \                  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                 ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}                  ${_LIB_SO_TGTLIBDIR}.${SHLIB_MAJOR}
   .endif
 .endif  .endif
 .if ${MKLINKLIB} != "no"  .if ${MKLINKLIB} != "no"
         ${INSTALL_SYMLINK} \          ${INSTALL_SYMLINK} \
                 lib${LIB}.so.${SHLIB_FULLVERSION} \                  ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
                 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so                  ${_LIB_SO_TGT}
 .if ${_LIBSODIR} != ${LIBDIR}  .if ${_LIBSODIR} != ${LIBDIR}
         ${INSTALL_SYMLINK} \          ${INSTALL_SYMLINK} -l r \
                 -l r ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \                  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                 ${DESTDIR}${LIBDIR}/lib${LIB}.so                  ${_LIB_SO_TGTLIBDIR}
 .endif  .endif
 .endif  .endif
 .endif  .endif
 .endif  .endif
   
 .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)  .if ${MKLINT} != "no" && !empty(LOBJS)
 libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln  libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
 .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln  .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
   

Legend:
Removed from v.1.273  
changed lines
  Added in v.1.273.4.2

CVSweb <webmaster@jp.NetBSD.org>