[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.216 and 1.224

version 1.216, 2003/04/22 12:55:26 version 1.224, 2003/07/22 06:53:22
Line 3 
Line 3 
   
 .include <bsd.init.mk>  .include <bsd.init.mk>
 .include <bsd.shlib.mk>  .include <bsd.shlib.mk>
   .include <bsd.gcc.mk>
   
 ##### Basic targets  ##### Basic targets
 .PHONY:         checkver cleanlib libinstall  .PHONY:         checkver cleanlib libinstall
Line 68  SHLIB_FULLVERSION=${SHLIB_MAJOR}
Line 69  SHLIB_FULLVERSION=${SHLIB_MAJOR}
 # add additional suffixes not exported.  # add additional suffixes not exported.
 # .po is used for profiling object files.  # .po is used for profiling object files.
 # .so is used for PIC object files.  # .so is used for PIC object files.
 .SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h  .SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .cpp .cxx .C .m .F .f .r .y .l .cl .p .h
 .SUFFIXES: .sh .m4 .m  .SUFFIXES: .sh .m4 .m
   
   
Line 99  SHLIB_FULLVERSION=${SHLIB_MAJOR}
Line 100  SHLIB_FULLVERSION=${SHLIB_MAJOR}
   
 FPICFLAGS ?= -fPIC  FPICFLAGS ?= -fPIC
 CPICFLAGS ?= -fPIC -DPIC  CPICFLAGS ?= -fPIC -DPIC
 CPPPICFLAGS?= -DPIC  CPPPICFLAGS?= -DPIC
 CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}  CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
 APICFLAGS ?=  APICFLAGS ?=
   
 .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \  .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
        ${OBJECT_FMT} == "ELF"         ${OBJECT_FMT} == "ELF"
   
 # If you use -fPIC you need to define BIGPIC to turn on 32-bit  # If you use -fPIC you need to define BIGPIC to turn on 32-bit
 # relocations in asm code  # relocations in asm code
 FPICFLAGS ?= -fPIC  FPICFLAGS ?= -fPIC
 CPICFLAGS ?= -fPIC -DPIC  CPICFLAGS ?= -fPIC -DPIC
Line 118  APICFLAGS ?= -KPIC
Line 119  APICFLAGS ?= -KPIC
   
 FPICFLAGS ?= -fPIC  FPICFLAGS ?= -fPIC
 CPICFLAGS?= -fPIC -DPIC  CPICFLAGS?= -fPIC -DPIC
 CPPPICFLAGS?= -DPIC  CPPPICFLAGS?= -DPIC
 CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}  CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
 APICFLAGS?= -k  APICFLAGS?= -k
 # XXX libraries often need the millicode functions in libgcc.a,  # XXX libraries often need the millicode functions in libgcc.a,
Line 132  SHLIB_SOVERSION=${SHLIB_FULLVERSION}
Line 133  SHLIB_SOVERSION=${SHLIB_FULLVERSION}
 SHLIB_SHFLAGS=  SHLIB_SHFLAGS=
 FPICFLAGS ?= -fPIC  FPICFLAGS ?= -fPIC
 CPICFLAGS?= -fPIC -DPIC  CPICFLAGS?= -fPIC -DPIC
 CPPPICFLAGS?= -DPIC  CPPPICFLAGS?= -DPIC
 CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}  CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
 APICFLAGS?= -k  APICFLAGS?= -k
   
Line 151  MKSHLIBOBJS= no
Line 152  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=          -soname lib${LIB}.so.${SHLIB_SOVERSION}  SHLIB_SHFLAGS=          -Wl,-soname,lib${LIB}.so.${SHLIB_SOVERSION}
 SHLIB_LDSTARTFILE?=     ${DESTDIR}/usr/lib/crti.o ${DESTDIR}/usr/lib/crtbeginS.o  SHLIB_LDSTARTFILE?=     ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGINS}
 # Some platforms require additional endfile support.  SHLIB_LDENDFILE?=       ${_GCC_CRTENDS} ${DESTDIR}/usr/lib/crtn.o
 .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}
Line 167  FFLAGS+= ${FOPTS}
Line 162  FFLAGS+= ${FOPTS}
   
 .c.o:  .c.o:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.c} ${.IMPSRC}          ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
 .else  .else
         @echo ${COMPILE.c:Q} ${.IMPSRC}          @echo ${COMPILE.c:Q} ${COPTS.${.IMPSRC:T}:Q} ${CPUFLAGS.${.IMPSRC:T}:Q} ${CPPFLAGS.${.IMPSRC:T}:Q} ${.IMPSRC}
         @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.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
   
 .c.po:  .c.po:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}          ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
 .else  .else
         @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.c:Q} ${COPTS.${.IMPSRC:T}:Q} ${CPUFLAGS.${.IMPSRC:T}:Q} ${CPPFLAGS.${.IMPSRC:T}:Q} -pg ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.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
   
 .c.so:  .c.so:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.c} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}          ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else  .else
         @echo ${COMPILE.c:Q} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}          @echo ${COMPILE.c:Q} ${COPTS.${.IMPSRC:T}:Q} ${CPUFLAGS.${.IMPSRC:T}:Q} ${CPPFLAGS.${.IMPSRC:T}:Q} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
         @${COMPILE.c} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.o          @${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${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
   
 .c.ln:  .c.ln:
         ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}          ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${CPPFLAGS.${.IMPSRC:T}:M-[-IDU]*} -i ${.IMPSRC}
   
 .cc.o .C.o:  .cc.o .cpp.o .cxx.o .C.o:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.cc} ${.IMPSRC}          ${COMPILE.cc} ${.IMPSRC}
 .else  .else
Line 208  FFLAGS+= ${FOPTS}
Line 203  FFLAGS+= ${FOPTS}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
 .endif  .endif
   
 .cc.po .C.po:  .cc.po .cpp.po .cxx.o .C.po:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}          ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
 .else  .else
Line 218  FFLAGS+= ${FOPTS}
Line 213  FFLAGS+= ${FOPTS}
         @rm -f ${.TARGET}.o          @rm -f ${.TARGET}.o
 .endif  .endif
   
 .cc.so .C.so:  .cc.so .cpp.so .cxx.so .C.so:
 .if defined(COPTS) && !empty(COPTS:M*-g*)  .if defined(COPTS) && !empty(COPTS:M*-g*)
         ${COMPILE.cc} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}          ${COMPILE.cc} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else  .else
Line 259  FFLAGS+= ${FOPTS}
Line 254  FFLAGS+= ${FOPTS}
 .endif  .endif
   
 .f.ln:  .f.ln:
         ${ECHO} Skipping lint for Fortran libraries.          @echo Skipping lint for Fortran libraries.
   
 .m.o:  .m.o:
 .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)  .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
Line 354  _LIBS+=llib-l${LIB}.ln
Line 349  _LIBS+=llib-l${LIB}.ln
         || ${MKLINKLIB} != "no"          || ${MKLINKLIB} != "no"
 ALLOBJS=${OBJS} ${POBJS} ${SOBJS}  ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
 .else  .else
 ALLOBJS=${POBJS} ${SOBJS}  ALLOBJS=${POBJS} ${SOBJS}
 .endif  .endif
 .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)  .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
 ALLOBJS+=${LOBJS}  ALLOBJS+=${LOBJS}
Line 397  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
Line 392  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
         @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)          @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
         @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}          @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
 .if defined(DESTDIR)  .if defined(DESTDIR)
         $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \          $(CC) -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ \
             ${SHLIB_LDSTARTFILE} \              -Wl,-x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
             --whole-archive ${SOLIB} \              -Wl,--whole-archive ${SOLIB} \
             --no-whole-archive ${LDADD} \              -Wl,--no-whole-archive ${LDADD} \
             -L${DESTDIR}${_LIBSODIR} -L${DESTDIR}${LIBDIR} \              -L${_GCC_LIBGCCDIR} -L${DESTDIR}${_LIBSODIR} -L${DESTDIR}${LIBDIR} \
             -R${_LIBSODIR} -R${LIBDIR} \              -R${_LIBSODIR} -R${LIBDIR}
             ${SHLIB_LDENDFILE}  .else
 .else          $(CC) -Wl,-x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
         $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \              -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${LDADD}
             ${SHLIB_LDSTARTFILE} \  
             --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \  
             ${SHLIB_LDENDFILE}  
 .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
Line 441  cleanlib:
Line 433  cleanlib:
   
 .if defined(SRCS)  .if defined(SRCS)
 afterdepend: .depend  afterdepend: .depend
         @(TMP=/tmp/_depend$$$$; \          @(TMP=/tmp/_depend$$$$; trap 'rm -f $$TMP ; exit 1' 1 2 3 13 15; \
             sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \              sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
               < .depend > $$TMP; \                < .depend > $$TMP && \
             mv $$TMP .depend)              mv $$TMP .depend)
 .endif  .endif
   

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

CVSweb <webmaster@jp.NetBSD.org>