[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.168 and 1.216

version 1.168, 2000/06/06 09:22:01 version 1.216, 2003/04/22 12:55:26
Line 1 
Line 1 
 #       $NetBSD$  #       $NetBSD$
 #       @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94  #       @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
   
 .if !target(__initialized__)  .include <bsd.init.mk>
 __initialized__:  .include <bsd.shlib.mk>
 .if exists(${.CURDIR}/../Makefile.inc)  
 .include "${.CURDIR}/../Makefile.inc"  
 .endif  
 .include <bsd.own.mk>  
 .include <bsd.obj.mk>  
 .include <bsd.depall.mk>  
 .MAIN:          all  
 .endif  
   
   ##### Basic targets
 .PHONY:         checkver cleanlib libinstall  .PHONY:         checkver cleanlib libinstall
 realinstall:    checkver libinstall  realinstall:    checkver libinstall
 clean cleandir distclean: cleanlib  clean:          cleanlib
   
   ##### Build and install rules
   CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
   CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include/g++}
   
 .if exists(${SHLIB_VERSION_FILE})  .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})
 SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major  SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
 SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor  SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
   SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
   
 # Check for higher installed library versions.  # Check for higher installed library versions.
 .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \  .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
         exists(${BSDSRCDIR}/lib/checkver)          exists(${NETBSDSRCDIR}/lib/checkver)
 checkver:  checkver:
         @(cd ${.CURDIR} && \          @(cd ${.CURDIR} && \
                 ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \                  sh ${NETBSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
                     -d ${DESTDIR}${LIBDIR} ${LIB})                      -d ${DESTDIR}${_LIBSODIR} ${LIB})
 .else  .endif
   .endif
   
   .if !target(checkver)
 checkver:  checkver:
 .endif  .endif
   
   print-shlib-major:
   .if defined(SHLIB_MAJOR) && ${MKPIC} != "no"
           @echo ${SHLIB_MAJOR}
 .else  .else
 checkver:          @false
   .endif
   
   print-shlib-minor:
   .if defined(SHLIB_MINOR) && ${MKPIC} != "no"
           @echo ${SHLIB_MINOR}
   .else
           @false
   .endif
   
   print-shlib-teeny:
   .if defined(SHLIB_TEENY) && ${MKPIC} != "no"
           @echo ${SHLIB_TEENY}
   .else
           @false
   .endif
   
   .if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
   .if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
   .if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
   SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
   .else
   SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
   .endif
   .else
   SHLIB_FULLVERSION=${SHLIB_MAJOR}
   .endif
 .endif  .endif
   
 # add additional suffixes not exported.  # add additional suffixes not exported.
Line 49  checkver:
Line 80  checkver:
 # OBJECT_FMT:           currently either "ELF" or "a.out", from <bsd.own.mk>  # OBJECT_FMT:           currently either "ELF" or "a.out", from <bsd.own.mk>
 # SHLIB_SOVERSION:      version number to be compiled into a shared library  # SHLIB_SOVERSION:      version number to be compiled into a shared library
 #                       via -soname. Usualy ${SHLIB_MAJOR} on ELF.  #                       via -soname. Usualy ${SHLIB_MAJOR} on ELF.
 #                       NetBSD/pmax used to use ${SHLIB_MAJOR}.{SHLIB-MINOR}.  #                       NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
   #                       [.${SHLIB_TEENY}]]
 # SHLIB_SHFLAGS:        Flags to tell ${LD} to emit shared library.  # SHLIB_SHFLAGS:        Flags to tell ${LD} to emit shared library.
 #                       with ELF, also set shared-lib version for ld.so.  #                       with ELF, also set shared-lib version for ld.so.
 # SHLIB_LDSTARTFILE:    support .o file, call C++ file-level constructors  # SHLIB_LDSTARTFILE:    support .o file, call C++ file-level constructors
 # SHLIB_LDENDFILE:      support .o file, call C++ file-level destructors  # SHLIB_LDENDFILE:      support .o file, call C++ file-level destructors
   # FPICFLAGS:            flags for ${FC} to compile .[fF] files to .so objects.
 # CPPICFLAGS:           flags for ${CPP} to preprocess .[sS] files for ${AS}  # CPPICFLAGS:           flags for ${CPP} to preprocess .[sS] files for ${AS}
 # CPICFLAGS:            flags for ${CC} to compile .[cC] files to .so objects.  # CPICFLAGS:            flags for ${CC} to compile .[cC] files to pic objects.
 # CAPICFLAGS            flags for {$CC} to compiling .[Ss] files  # CSHLIBFLAGS:          flags for ${CC} to compile .[cC] files to .so objects.
   #                       (usually includes ${CPICFLAGS})
   # CAPICFLAGS:           flags for ${CC} to compiling .[Ss] files
 #                       (usually just ${CPPPICFLAGS} ${CPICFLAGS})  #                       (usually just ${CPPPICFLAGS} ${CPICFLAGS})
 # APICFLAGS:            flags for ${AS} to assemble .[sS] to .so objects.  # APICFLAGS:            flags for ${AS} to assemble .[sS] to .so objects.
   
 .if ${MACHINE_ARCH} == "alpha"  .if ${MACHINE_ARCH} == "alpha"
                 # Alpha-specific shared library flags  
   FPICFLAGS ?= -fPIC
 CPICFLAGS ?= -fPIC -DPIC  CPICFLAGS ?= -fPIC -DPIC
 CPPPICFLAGS?= -DPIC  CPPPICFLAGS?= -DPIC
 CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}  CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
 APICFLAGS ?=  APICFLAGS ?=
 .elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"  
                 # mips-specific shared library flags  
   
 # On mips, all libs are compiled with ABIcalls, not just sharedlibs.  .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
 MKPICLIB= no         ${OBJECT_FMT} == "ELF"
   
 # so turn shlib PIC flags on for ${AS}.  # If you use -fPIC you need to define BIGPIC to turn on 32-bit
 AINC+=-DABICALLS  # relocations in asm code
 AFLAGS+= -fPIC  FPICFLAGS ?= -fPIC
 AS+=    -KPIC  CPICFLAGS ?= -fPIC -DPIC
   CPPPICFLAGS?= -DPIC -DBIGPIC
   CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
   APICFLAGS ?= -KPIC
   
 .elif ${MACHINE_ARCH} == "sparc" && ${OBJECT_FMT} == "ELF"  .elif ${MACHINE_ARCH} == "hppa"
   
 CPICFLAGS ?= -fPIC -DPIC  FPICFLAGS ?= -fPIC
   CPICFLAGS?= -fPIC -DPIC
 CPPPICFLAGS?= -DPIC  CPPPICFLAGS?= -DPIC
 CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}  CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
 APICFLAGS ?= -KPIC  APICFLAGS?= -k
   # XXX libraries often need the millicode functions in libgcc.a,
   # so we have to work around the -nostdlib:
   LDADD+= `$(CC) -print-libgcc-file-name`
   
 .else  .else
   
 # Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)  # Platform-independent flags for NetBSD a.out shared libraries
 SHLIB_LDSTARTFILE=  SHLIB_SOVERSION=${SHLIB_FULLVERSION}
 SHLIB_LDENDFILE=  
 SHLIB_SHFLAGS=  SHLIB_SHFLAGS=
 SHLIB_SOVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}  FPICFLAGS ?= -fPIC
 CPICFLAGS?= -fPIC -DPIC  CPICFLAGS?= -fPIC -DPIC
 CPPPICFLAGS?= -DPIC  CPPPICFLAGS?= -DPIC
 CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}  CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
Line 98  APICFLAGS?= -k
Line 138  APICFLAGS?= -k
   
 .endif  .endif
   
 MKPICLIB?= yes  .if ${MKPICLIB} != "no"
   CSHLIBFLAGS+= ${CPICFLAGS}
   .endif
   
   .if defined(CSHLIBFLAGS) && !empty(CSHLIBFLAGS)
   MKSHLIBOBJS= yes
   .else
   MKSHLIBOBJS= no
   .endif
   
 # 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=-soname lib${LIB}.so.${SHLIB_SOVERSION}  SHLIB_SHFLAGS=          -soname lib${LIB}.so.${SHLIB_SOVERSION}
 SHLIB_LDSTARTFILE= ${DESTDIR}/usr/lib/crtbeginS.o  SHLIB_LDSTARTFILE?=     ${DESTDIR}/usr/lib/crti.o ${DESTDIR}/usr/lib/crtbeginS.o
 SHLIB_LDENDFILE= ${DESTDIR}/usr/lib/crtendS.o  # Some platforms require additional endfile support.
   .if ${MACHINE_ARCH} == "powerpc" && defined(HAVE_GCC3)
   SHLIB_LDENDFILE?=       ${DESTDIR}/usr/lib/crtsavres.o \
                           ${DESTDIR}/usr/lib/crtendS.o ${DESTDIR}/usr/lib/crtn.o
   .else
   SHLIB_LDENDFILE?=       ${DESTDIR}/usr/lib/crtendS.o ${DESTDIR}/usr/lib/crtn.o
   .endif
 .endif  .endif
   
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
   FFLAGS+=        ${FOPTS}
   
 .c.o:  .c.o:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
Line 132  CFLAGS+= ${COPTS}
Line 187  CFLAGS+= ${COPTS}
   
 .c.so:  .c.so:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}          ${COMPILE.c} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else  .else
         @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.c:Q} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.c} ${CSHLIBFLAGS} ${.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
 .endif  .endif
Line 165  CFLAGS+= ${COPTS}
Line 220  CFLAGS+= ${COPTS}
   
 .cc.so .C.so:  .cc.so .C.so:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}          ${COMPILE.cc} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else  .else
         @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.cc} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.o
           @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
           @rm -f ${.TARGET}.o
   .endif
   
   .f.o:
   .if defined(FOPTS) && !empty(FOPTS:M*-g*)
           ${COMPILE.f} ${.IMPSRC}
   .else
           @echo ${COMPILE.f:Q} ${.IMPSRC}
           @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
           @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
           @rm -f ${.TARGET}.o
   .endif
   
   .f.po:
   .if defined(FOPTS) && !empty(FOPTS:M*-g*)
           ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
   .else
           @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
           @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
           @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
           @rm -f ${.TARGET}.o
   .endif
   
   .f.so:
   .if defined(FOPTS) && !empty(FOPTS:M*-g*)
           ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
   .else
           @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
           @${COMPILE.f} ${FPICFLAGS} ${.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
 .endif  .endif
   
   .f.ln:
           ${ECHO} Skipping lint for Fortran libraries.
   
 .m.o:  .m.o:
 .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)  .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
         ${COMPILE.m} ${.IMPSRC}          ${COMPILE.m} ${.IMPSRC}
Line 195  CFLAGS+= ${COPTS}
Line 283  CFLAGS+= ${COPTS}
   
 .m.so:  .m.so:
 .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)  .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
         ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}          ${COMPILE.m} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else  .else
         @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.m} ${CSHLIBFLAGS} ${.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
 .endif  .endif
Line 221  CFLAGS+= ${COPTS}
Line 309  CFLAGS+= ${COPTS}
         @${LD} -x -r ${.TARGET}.o -o ${.TARGET}          @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
   
   .if defined(LIB)
 .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \  .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
         || ${MKLINKLIB} != "no"          || ${MKLINKLIB} != "no"
 _LIBS=lib${LIB}.a  _LIBS=lib${LIB}.a
Line 237  POBJS+=${OBJS:.o=.po}
Line 326  POBJS+=${OBJS:.o=.po}
   
 .if ${MKPIC} != "no"  .if ${MKPIC} != "no"
 .if ${MKPICLIB} == "no"  .if ${MKPICLIB} == "no"
   .if ${MKSHLIBOBJS} != "no"
   # make _pic.a, which isn't really pic,
   # since it's needed for making shared lib.
   # but don't install it.
   SOLIB=lib${LIB}_pic.a
   SOBJS+=${OBJS:.o=.so}
   .else
 SOLIB=lib${LIB}.a  SOLIB=lib${LIB}.a
   .endif
 .else  .else
 SOLIB=lib${LIB}_pic.a  SOLIB=lib${LIB}_pic.a
 _LIBS+=${SOLIB}  _LIBS+=${SOLIB}
 SOBJS+=${OBJS:.o=.so}  SOBJS+=${OBJS:.o=.so}
 .endif  .endif
 .if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)  .if defined(SHLIB_FULLVERSION)
 _LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}  _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
 .endif  .endif
 .endif  .endif
   
 .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"  
 _LIBS+=llib-l${LIB}.ln  
 LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}  LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
   .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
   _LIBS+=llib-l${LIB}.ln
 .endif  .endif
   
 .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \  .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
         || ${MKLINKLIB} != "no"          || ${MKLINKLIB} != "no"
 ALLOBJS=${OBJS} ${POBJS} ${SOBJS} ${LOBJS}  ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
   .else
   ALLOBJS=${POBJS} ${SOBJS}
   .endif
   .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
   ALLOBJS+=${LOBJS}
   .endif
 .else  .else
 ALLOBJS=${POBJS} ${SOBJS} ${LOBJS}  LOBJS=
   SOBJS=
 .endif  .endif
 .NOPATH: ${ALLOBJS} ${_LIBS}  
   .NOPATH: ${ALLOBJS} ${_LIBS} ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
   
 realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}  realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
   
Line 269  __archivebuild: .USE
Line 374  __archivebuild: .USE
         ${RANLIB} ${.TARGET}          ${RANLIB} ${.TARGET}
   
 __archiveinstall: .USE  __archiveinstall: .USE
         ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \          ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
             -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}              ${UPDATE:D:U-a "${RANLIB} -t"} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
         ${RANLIB} -t ${.TARGET}  
         chmod ${LIBMODE} ${.TARGET}  __archivesymlinkpic: .USE
           ${INSTALL_SYMLINK} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
 DPSRCS+=        ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}  
 CLEANFILES+=    ${DPSRCS}  DPSRCS+=        ${SRCS:M*.[ly]:C/\..$/.c/}
 .if defined(YHEADER)  CLEANFILES+=    ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}
 CLEANFILES+=    ${SRCS:M*.y:.y=.h}  
 .endif  
   
 lib${LIB}.a:: ${OBJS} __archivebuild  lib${LIB}.a:: ${OBJS} __archivebuild
         @echo building standard ${LIB} library          @echo building standard ${LIB} library
Line 289  lib${LIB}_p.a:: ${POBJS} __archivebuild
Line 392  lib${LIB}_p.a:: ${POBJS} __archivebuild
 lib${LIB}_pic.a:: ${SOBJS} __archivebuild  lib${LIB}_pic.a:: ${SOBJS} __archivebuild
         @echo building shared object ${LIB} library          @echo building shared object ${LIB} library
   
 lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOLIB} ${DPADD} \  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}      ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
         @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)          @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
         @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}          @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
 .if defined(DESTDIR)  .if defined(DESTDIR)
         $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \          $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
             ${SHLIB_LDSTARTFILE} \              ${SHLIB_LDSTARTFILE} \
             --whole-archive ${SOLIB} \              --whole-archive ${SOLIB} \
             -L${DESTDIR}${LIBDIR} -R${LIBDIR} \  
             --no-whole-archive ${LDADD} \              --no-whole-archive ${LDADD} \
               -L${DESTDIR}${_LIBSODIR} -L${DESTDIR}${LIBDIR} \
               -R${_LIBSODIR} -R${LIBDIR} \
             ${SHLIB_LDENDFILE}              ${SHLIB_LDENDFILE}
 .else  .else
         $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \          $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
Line 307  lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINO
Line 411  lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINO
             ${SHLIB_LDENDFILE}              ${SHLIB_LDENDFILE}
 .endif  .endif
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
         rm -f lib${LIB}.so.${SHLIB_MAJOR}  #  We don't use INSTALL_SYMLINK here because this is just
         ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \  #  happening inside the build directory/objdir. XXX Why does
             lib${LIB}.so.${SHLIB_MAJOR}  #  this spend so much effort on libraries that aren't live??? XXX
         rm -f lib${LIB}.so          ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
         ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \          mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
             lib${LIB}.so          ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
           mv -f lib${LIB}.so.tmp lib${LIB}.so
 .endif  .endif
   
   .if !empty(LOBJS)
 LLIBS?=         -lc  LLIBS?=         -lc
 llib-l${LIB}.ln: ${LOBJS}  llib-l${LIB}.ln: ${LOBJS}
         @echo building llib-l${LIB}.ln          @echo building llib-l${LIB}.ln
         @rm -f llib-l${LIB}.ln          @rm -f llib-l${LIB}.ln
   .if defined(DESTDIR)
           @${LINT} -C${LIB} ${.ALLSRC} -L${DESTDIR}/usr/libdata ${LLIBS}
   .else
         @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}          @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
   .endif
   .endif
   
 cleanlib:  cleanlib:
         rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}          rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
Line 343  libinstall::
Line 454  libinstall::
 .if ${MKLINKLIB} != "no"  .if ${MKLINKLIB} != "no"
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a  libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a  .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
   
 .if !defined(UPDATE)  .if !defined(UPDATE)
 .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a  .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
   ${DESTDIR}${LIBDIR}/lib${LIB}.a! .MADE
 .endif  .endif
   ${DESTDIR}${LIBDIR}/lib${LIB}.a! lib${LIB}.a __archiveinstall
   .else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)  .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
 ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE  ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
 .endif  .endif
 ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall  ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
 .endif  .endif
   .endif
   
 .if ${MKPROFILE} != "no"  .if ${MKPROFILE} != "no"
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a  libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a  .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
   
 .if !defined(UPDATE)  .if !defined(UPDATE)
 .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a  .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
   ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! .MADE
 .endif  .endif
   ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! lib${LIB}_p.a __archiveinstall
   .else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)  .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
 ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE  ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
 .endif  .endif
 ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall  ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
 .endif  .endif
   .endif
   
 .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"  .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a  libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a  .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
   
 .if !defined(UPDATE)  .if !defined(UPDATE)
 .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a  .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
   ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! .MADE
 .endif  .endif
   .if ${MKPICLIB} == "no"
   ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}.a __archivesymlinkpic
   .else
   ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}_pic.a __archiveinstall
   .endif
   .else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)  .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
 ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE  ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
 .endif  .endif
 .if ${MKPICLIB} == "no"  .if ${MKPICLIB} == "no"
 ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:  ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}.a __archivesymlinkpic
         rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a  
         ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a  
 .else  .else
 ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall  ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
 .endif  .endif
 .endif  .endif
   .endif
   
   .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
   libinstall:: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
   .PRECIOUS: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
   
 .if ${MKPIC} != "no" && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)  
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}  
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}  
 .if !defined(UPDATE)  .if !defined(UPDATE)
 .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}  .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
   ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! .MADE
 .endif  .endif
   ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR})  .else
 ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: .MADE  .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
   ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
   .endif
   ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
   .endif
           ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
                   ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
   .if ${_LIBSODIR} != ${LIBDIR}
           ${INSTALL_SYMLINK} ${SYSPKGTAG} \
                   ${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \
                   ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
 .endif  .endif
 ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}  
         ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \  
             -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}  
 .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)  .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
         /sbin/ldconfig -m ${LIBDIR}          /sbin/ldconfig -m ${_LIBSODIR} ${LIBDIR}
 .endif  .endif
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
         rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}          ${INSTALL_SYMLINK} ${SYSPKGTAG} \
         ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \                  lib${LIB}.so.${SHLIB_FULLVERSION} \
             ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}                  ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_MAJOR}
         rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so  .if ${_LIBSODIR} != ${LIBDIR}
           ${INSTALL_SYMLINK} ${SYSPKGTAG} \
                   ${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \
                   ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
   .endif
 .if ${MKLINKLIB} != "no"  .if ${MKLINKLIB} != "no"
         ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \          ${INSTALL_SYMLINK} ${SYSPKGTAG} \
             ${DESTDIR}${LIBDIR}/lib${LIB}.so                  lib${LIB}.so.${SHLIB_FULLVERSION} \
                   ${DESTDIR}${_LIBSODIR}/lib${LIB}.so
   .if ${_LIBSODIR} != ${LIBDIR}
           ${INSTALL_SYMLINK} ${SYSPKGTAG} \
                   ${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \
                   ${DESTDIR}${LIBDIR}/lib${LIB}.so
   .endif
 .endif  .endif
 .endif  .endif
 .endif  .endif
   
 .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"  .if ${MKLINT} != "no" && ${MKLINKLIB} != "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
   
 .if !defined(UPDATE)  .if !defined(UPDATE)
 .PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln  .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
   ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! .MADE
 .endif  .endif
   ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! llib-l${LIB}.ln
   .else
 .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)  .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
 ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE  ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
 .endif  .endif
 ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln  ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
         ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \  .endif
             -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}          ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
                   ${SYSPKGTAG} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
 .endif  .endif
 .endif  .endif
   
   ##### Pull in related .mk logic
 .include <bsd.man.mk>  .include <bsd.man.mk>
 .include <bsd.nls.mk>  .include <bsd.nls.mk>
 .include <bsd.files.mk>  .include <bsd.files.mk>
Line 437  ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln:
Line 586  ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln:
 .include <bsd.dep.mk>  .include <bsd.dep.mk>
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   
 # Make sure all of the standard targets are defined, even if they do nothing.  ${TARGETS}:     # ensure existence
 lint regress:  

Legend:
Removed from v.1.168  
changed lines
  Added in v.1.216

CVSweb <webmaster@jp.NetBSD.org>