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

Annotation of src/share/mk/bsd.lib.mk, Revision 1.188

1.188   ! tv          1: #      $NetBSD: bsd.lib.mk,v 1.187 2001/10/25 19:32:15 nathanw Exp $
1.92      mikel       2: #      @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
1.1       cgd         3:
1.188   ! tv          4: .include <bsd.init.mk>
1.97      mycroft     5:
1.188   ! tv          6: ##### Basic targets
1.143     erh         7: .PHONY:                checkver cleanlib libinstall
                      8: realinstall:   checkver libinstall
1.183     tv          9: clean:         cleanlib
1.1       cgd        10:
1.188   ! tv         11: ##### Build and install rules
1.184     tv         12: .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})
1.154     simonb     13: SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
                     14: SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
1.171     christos   15: SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
1.143     erh        16:
                     17: # Check for higher installed library versions.
1.145     erh        18: .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
                     19:        exists(${BSDSRCDIR}/lib/checkver)
1.143     erh        20: checkver:
1.144     erh        21:        @(cd ${.CURDIR} && \
1.176     gmcgarry   22:                sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
1.154     simonb     23:                    -d ${DESTDIR}${LIBDIR} ${LIB})
1.173     christos   24: .endif
                     25: .endif
                     26:
                     27: .if !target(checkver)
1.143     erh        28: checkver:
                     29: .endif
1.173     christos   30:
1.169     thorpej    31: print-shlib-major:
1.185     tv         32: .if defined(SHLIB_MAJOR) && ${MKPIC} != "no"
1.169     thorpej    33:        @echo ${SHLIB_MAJOR}
1.173     christos   34: .else
                     35:        @false
                     36: .endif
1.169     thorpej    37:
                     38: print-shlib-minor:
1.185     tv         39: .if defined(SHLIB_MINOR) && ${MKPIC} != "no"
1.169     thorpej    40:        @echo ${SHLIB_MINOR}
1.173     christos   41: .else
                     42:        @false
                     43: .endif
1.171     christos   44:
                     45: print-shlib-teeny:
1.185     tv         46: .if defined(SHLIB_TEENY) && ${MKPIC} != "no"
1.171     christos   47:        @echo ${SHLIB_TEENY}
1.143     erh        48: .else
1.169     thorpej    49:        @false
1.173     christos   50: .endif
1.169     thorpej    51:
1.173     christos   52: .if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
                     53: .if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
                     54: .if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
                     55: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
                     56: .else
                     57: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
                     58: .endif
                     59: .else
                     60: SHLIB_FULLVERSION=${SHLIB_MAJOR}
                     61: .endif
1.35      pk         62: .endif
1.1       cgd        63:
1.101     mycroft    64: # add additional suffixes not exported.
                     65: # .po is used for profiling object files.
                     66: # .so is used for PIC object files.
1.118     lukem      67: .SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
                     68: .SUFFIXES: .sh .m4 .m
1.82      mikel      69:
1.86      jonathan   70:
                     71: # Set PICFLAGS to cc flags for producing position-independent code,
                     72: # if not already set.  Includes -DPIC, if required.
                     73:
1.164     simonb     74: # Data-driven table using make variables to control how shared libraries
1.86      jonathan   75: # are built for different platforms and object formats.
1.125     jonathan   76: # OBJECT_FMT:          currently either "ELF" or "a.out", from <bsd.own.mk>
1.164     simonb     77: # SHLIB_SOVERSION:     version number to be compiled into a shared library
                     78: #                      via -soname. Usualy ${SHLIB_MAJOR} on ELF.
1.173     christos   79: #                      NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
                     80: #                      [.${SHLIB_TEENY}]]
1.164     simonb     81: # SHLIB_SHFLAGS:       Flags to tell ${LD} to emit shared library.
1.123     jonathan   82: #                      with ELF, also set shared-lib version for ld.so.
                     83: # SHLIB_LDSTARTFILE:   support .o file, call C++ file-level constructors
                     84: # SHLIB_LDENDFILE:     support .o file, call C++ file-level destructors
1.179     dmcmahil   85: # FPICFLAGS:           flags for ${FC} to compile .[fF] files to .so objects.
1.164     simonb     86: # CPPICFLAGS:          flags for ${CPP} to preprocess .[sS] files for ${AS}
                     87: # CPICFLAGS:           flags for ${CC} to compile .[cC] files to .so objects.
                     88: # CAPICFLAGS           flags for {$CC} to compiling .[Ss] files
1.107     jonathan   89: #                      (usually just ${CPPPICFLAGS} ${CPICFLAGS})
1.164     simonb     90: # APICFLAGS:           flags for ${AS} to assemble .[sS] to .so objects.
1.86      jonathan   91:
1.148     lukem      92: .if ${MACHINE_ARCH} == "alpha"
1.123     jonathan   93:                # Alpha-specific shared library flags
1.179     dmcmahil   94: FPICFLAGS ?= -fPIC
1.165     dmcmahil   95: CPICFLAGS ?= -fPIC -DPIC
1.107     jonathan   96: CPPPICFLAGS?= -DPIC
                     97: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                     98: APICFLAGS ?=
1.151     drochner   99: .elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
1.123     jonathan  100:                # mips-specific shared library flags
1.86      jonathan  101:
1.160     simonb    102: # On mips, all libs are compiled with ABIcalls, not just sharedlibs.
                    103: MKPICLIB= no
                    104:
                    105: # so turn shlib PIC flags on for ${AS}.
                    106: AINC+=-DABICALLS
1.86      jonathan  107: AFLAGS+= -fPIC
                    108: AS+=   -KPIC
1.172     matt      109:
                    110: .elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
                    111: # On the VAX, all object are PIC by default, not just sharedlibs.
                    112: MKPICLIB= no
1.150     christos  113:
1.175     mrg       114: .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
                    115:        ${OBJECT_FMT} == "ELF"
1.150     christos  116:
1.179     dmcmahil  117: FPICFLAGS ?= -fPIC
1.165     dmcmahil  118: CPICFLAGS ?= -fPIC -DPIC
1.150     christos  119: CPPPICFLAGS?= -DPIC
                    120: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    121: APICFLAGS ?= -KPIC
1.86      jonathan  122:
                    123: .else
                    124:
1.187     nathanw   125: # Platform-independent flags for NetBSD a.out shared libraries
1.171     christos  126: SHLIB_SOVERSION=${SHLIB_FULLVERSION}
1.125     jonathan  127: SHLIB_SHFLAGS=
1.179     dmcmahil  128: FPICFLAGS ?= -fPIC
1.165     dmcmahil  129: CPICFLAGS?= -fPIC -DPIC
1.107     jonathan  130: CPPPICFLAGS?= -DPIC
                    131: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    132: APICFLAGS?= -k
1.86      jonathan  133:
                    134: .endif
                    135:
1.160     simonb    136: MKPICLIB?= yes
                    137:
1.123     jonathan  138: # Platform-independent linker flags for ELF shared libraries
1.148     lukem     139: .if ${OBJECT_FMT} == "ELF"
1.182     mrg       140: SHLIB_SOVERSION=       ${SHLIB_MAJOR}
                    141: SHLIB_SHFLAGS=         -soname lib${LIB}.so.${SHLIB_SOVERSION}
                    142: SHLIB_LDSTARTFILE?=    ${DESTDIR}/usr/lib/crtbeginS.o
                    143: SHLIB_LDENDFILE?=      ${DESTDIR}/usr/lib/crtendS.o
1.123     jonathan  144: .endif
1.86      jonathan  145:
1.82      mikel     146: CFLAGS+=       ${COPTS}
1.179     dmcmahil  147: FFLAGS+=       ${FOPTS}
1.1       cgd       148:
                    149: .c.o:
1.153     christos  150: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    151:        ${COMPILE.c} ${.IMPSRC}
                    152: .else
1.80      christos  153:        @echo ${COMPILE.c:Q} ${.IMPSRC}
1.122     cgd       154:        @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  155:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    156:        @rm -f ${.TARGET}.o
1.153     christos  157: .endif
1.1       cgd       158:
                    159: .c.po:
1.153     christos  160: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    161:        ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
                    162: .else
1.80      christos  163:        @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68      cgd       164:        @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  165:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    166:        @rm -f ${.TARGET}.o
1.153     christos  167: .endif
1.17      mycroft   168:
1.27      pk        169: .c.so:
1.153     christos  170: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    171:        ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    172: .else
1.86      jonathan  173:        @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    174:        @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  175:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    176:        @rm -f ${.TARGET}.o
1.153     christos  177: .endif
1.27      pk        178:
1.58      cgd       179: .c.ln:
1.121     thorpej   180:        ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
1.58      cgd       181:
1.18      mycroft   182: .cc.o .C.o:
1.153     christos  183: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    184:        ${COMPILE.cc} ${.IMPSRC}
                    185: .else
1.80      christos  186:        @echo ${COMPILE.cc:Q} ${.IMPSRC}
1.62      christos  187:        @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
1.63      jtc       188:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1.62      christos  189:        @rm -f ${.TARGET}.o
1.153     christos  190: .endif
1.17      mycroft   191:
1.18      mycroft   192: .cc.po .C.po:
1.153     christos  193: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    194:        ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
                    195: .else
1.80      christos  196:        @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68      cgd       197:        @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  198:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    199:        @rm -f ${.TARGET}.o
1.153     christos  200: .endif
1.28      cgd       201:
                    202: .cc.so .C.so:
1.153     christos  203: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    204:        ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    205: .else
1.86      jonathan  206:        @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    207:        @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  208:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    209:        @rm -f ${.TARGET}.o
1.153     christos  210: .endif
1.118     lukem     211:
1.179     dmcmahil  212: .f.o:
                    213: .if defined(FOPTS) && !empty(FOPTS:M*-g*)
                    214:        ${COMPILE.f} ${.IMPSRC}
                    215: .else
                    216:        @echo ${COMPILE.f:Q} ${.IMPSRC}
                    217:        @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
                    218:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    219:        @rm -f ${.TARGET}.o
                    220: .endif
                    221:
                    222: .f.po:
                    223: .if defined(FOPTS) && !empty(FOPTS:M*-g*)
                    224:        ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
                    225: .else
                    226:        @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
                    227:        @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
                    228:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    229:        @rm -f ${.TARGET}.o
                    230: .endif
                    231:
                    232: .f.so:
                    233: .if defined(FOPTS) && !empty(FOPTS:M*-g*)
                    234:        ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    235: .else
                    236:        @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    237:        @${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
                    238:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    239:        @rm -f ${.TARGET}.o
                    240: .endif
                    241:
                    242: .f.ln:
                    243:        ${ECHO} Skipping lint for Fortran libraries.
                    244:
1.118     lukem     245: .m.o:
1.153     christos  246: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    247:        ${COMPILE.m} ${.IMPSRC}
                    248: .else
1.118     lukem     249:        @echo ${COMPILE.m:Q} ${.IMPSRC}
1.122     cgd       250:        @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
1.118     lukem     251:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    252:        @rm -f ${.TARGET}.o
1.153     christos  253: .endif
1.118     lukem     254:
                    255: .m.po:
1.153     christos  256: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    257:        ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
                    258: .else
1.118     lukem     259:        @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
                    260:        @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
                    261:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    262:        @rm -f ${.TARGET}.o
1.153     christos  263: .endif
1.118     lukem     264:
                    265: .m.so:
1.153     christos  266: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    267:        ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    268: .else
1.118     lukem     269:        @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    270:        @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
                    271:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    272:        @rm -f ${.TARGET}.o
1.153     christos  273: .endif
1.1       cgd       274:
1.40      cgd       275: .S.o .s.o:
1.80      christos  276:        @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
1.69      jtc       277:        @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  278:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    279:        @rm -f ${.TARGET}.o
1.1       cgd       280:
1.40      cgd       281: .S.po .s.po:
1.80      christos  282:        @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
1.75      jtc       283:        @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  284:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    285:        @rm -f ${.TARGET}.o
1.1       cgd       286:
1.40      cgd       287: .S.so .s.so:
1.107     jonathan  288:        @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
                    289:        @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  290:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    291:        @rm -f ${.TARGET}.o
1.27      pk        292:
1.148     lukem     293: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    294:        || ${MKLINKLIB} != "no"
1.130     tv        295: _LIBS=lib${LIB}.a
                    296: .else
                    297: _LIBS=
                    298: .endif
1.58      cgd       299:
1.167     matt      300: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.158     christos  301:
1.149     lukem     302: .if ${MKPROFILE} != "no"
1.130     tv        303: _LIBS+=lib${LIB}_p.a
1.167     matt      304: POBJS+=${OBJS:.o=.po}
1.1       cgd       305: .endif
                    306:
1.148     lukem     307: .if ${MKPIC} != "no"
1.160     simonb    308: .if ${MKPICLIB} == "no"
                    309: SOLIB=lib${LIB}.a
                    310: .else
                    311: SOLIB=lib${LIB}_pic.a
                    312: _LIBS+=${SOLIB}
1.167     matt      313: SOBJS+=${OBJS:.o=.so}
1.160     simonb    314: .endif
1.171     christos  315: .if defined(SHLIB_FULLVERSION)
                    316: _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
1.27      pk        317: .endif
1.35      pk        318: .endif
1.27      pk        319:
1.179     dmcmahil  320: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
                    321: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
1.58      cgd       322: _LIBS+=llib-l${LIB}.ln
1.27      pk        323: .endif
                    324:
1.167     matt      325: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    326:        || ${MKLINKLIB} != "no"
1.179     dmcmahil  327: ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
1.167     matt      328: .else
1.179     dmcmahil  329: ALLOBJS=${POBJS} ${SOBJS}
                    330: .endif
                    331: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
                    332: ALLOBJS+=${LOBJS}
1.167     matt      333: .endif
1.186     tv        334:
                    335: .NOPATH: ${ALLOBJS} ${_LIBS} ${SRCS:M*.[ly]:C/..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
1.158     christos  336:
1.162     mycroft   337: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
1.1       cgd       338:
1.90      christos  339: __archivebuild: .USE
1.89      christos  340:        @rm -f ${.TARGET}
1.138     tv        341:        @${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.89      christos  342:        ${RANLIB} ${.TARGET}
                    343:
                    344: __archiveinstall: .USE
1.188   ! tv        345:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
1.89      christos  346:        ${RANLIB} -t ${.TARGET}
1.188   ! tv        347: .if !defined(UNPRIVILEGED)
1.89      christos  348:        chmod ${LIBMODE} ${.TARGET}
1.188   ! tv        349: .endif
1.89      christos  350:
1.186     tv        351: DPSRCS+=       ${SRCS:M*.[ly]:C/..$/.c/}
                    352: CLEANFILES+=   ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}
1.103     mycroft   353:
1.89      christos  354: lib${LIB}.a:: ${OBJS} __archivebuild
1.1       cgd       355:        @echo building standard ${LIB} library
                    356:
1.89      christos  357: lib${LIB}_p.a:: ${POBJS} __archivebuild
1.1       cgd       358:        @echo building profiled ${LIB} library
                    359:
1.89      christos  360: lib${LIB}_pic.a:: ${SOBJS} __archivebuild
1.27      pk        361:        @echo building shared object ${LIB} library
                    362:
1.171     christos  363: lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
1.88      cgd       364:     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.171     christos  365:        @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
                    366:        @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
1.152     fair      367: .if defined(DESTDIR)
1.155     wrstuden  368:        $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.152     fair      369:            ${SHLIB_LDSTARTFILE} \
1.160     simonb    370:            --whole-archive ${SOLIB} \
1.170     erh       371:            --no-whole-archive ${LDADD} \
1.155     wrstuden  372:            -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
1.152     fair      373:            ${SHLIB_LDENDFILE}
                    374: .else
1.126     jonathan  375:        $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.123     jonathan  376:            ${SHLIB_LDSTARTFILE} \
1.160     simonb    377:            --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
1.115     cjs       378:            ${SHLIB_LDENDFILE}
1.152     fair      379: .endif
1.148     lukem     380: .if ${OBJECT_FMT} == "ELF"
1.177     mycroft   381:        ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
                    382:        mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
                    383:        ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
                    384:        mv -f lib${LIB}.so.tmp lib${LIB}.so
1.133     tv        385: .endif
1.35      pk        386:
1.179     dmcmahil  387: .if !empty(LOBJS)
1.103     mycroft   388: LLIBS?=                -lc
1.58      cgd       389: llib-l${LIB}.ln: ${LOBJS}
                    390:        @echo building llib-l${LIB}.ln
                    391:        @rm -f llib-l${LIB}.ln
1.141     wrstuden  392:        @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.179     dmcmahil  393: .endif
1.1       cgd       394:
1.81      cgd       395: cleanlib:
1.48      mycroft   396:        rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
1.59      cgd       397:        rm -f lib${LIB}.a ${OBJS}
                    398:        rm -f lib${LIB}_p.a ${POBJS}
1.133     tv        399:        rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
1.59      cgd       400:        rm -f llib-l${LIB}.ln ${LOBJS}
1.1       cgd       401:
1.26      mycroft   402: .if defined(SRCS)
1.64      christos  403: afterdepend: .depend
1.1       cgd       404:        @(TMP=/tmp/_depend$$$$; \
1.79      cgd       405:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
1.58      cgd       406:              < .depend > $$TMP; \
1.1       cgd       407:            mv $$TMP .depend)
1.26      mycroft   408: .endif
1.1       cgd       409:
1.97      mycroft   410: .if !target(libinstall)
1.148     lukem     411: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139     tv        412: libinstall::
                    413:
1.148     lukem     414: .if ${MKLINKLIB} != "no"
1.89      christos  415: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168     mycroft   416: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.89      christos  417: .if !defined(UPDATE)
                    418: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
                    419: .endif
1.168     mycroft   420:
1.157     fredb     421: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89      christos  422: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
                    423: .endif
                    424: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130     tv        425: .endif
1.89      christos  426:
1.149     lukem     427: .if ${MKPROFILE} != "no"
1.89      christos  428: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168     mycroft   429: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.89      christos  430: .if !defined(UPDATE)
                    431: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.32      pk        432: .endif
1.168     mycroft   433:
1.157     fredb     434: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89      christos  435: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
                    436: .endif
                    437: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
                    438: .endif
                    439:
1.149     lukem     440: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168     mycroft   441: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160     simonb    442: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.89      christos  443: .if !defined(UPDATE)
                    444: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    445: .endif
1.168     mycroft   446:
1.157     fredb     447: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89      christos  448: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33      pk        449: .endif
1.160     simonb    450: .if ${MKPICLIB} == "no"
                    451: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
                    452:        rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    453:        ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    454: .else
1.89      christos  455: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160     simonb    456: .endif
1.89      christos  457: .endif
                    458:
1.171     christos  459: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
                    460: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
                    461: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89      christos  462: .if !defined(UPDATE)
1.171     christos  463: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89      christos  464: .endif
1.168     mycroft   465:
1.171     christos  466: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
                    467: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
1.89      christos  468: .endif
1.171     christos  469: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.188   ! tv        470:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
        !           471:                ${.ALLSRC} ${.TARGET}
1.148     lukem     472: .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
1.146     thorpej   473:        /sbin/ldconfig -m ${LIBDIR}
                    474: .endif
1.148     lukem     475: .if ${OBJECT_FMT} == "ELF"
1.178     mycroft   476:        ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
1.177     mycroft   477:            ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
1.178     mycroft   478:        mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
1.83      cgd       479:            ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
1.148     lukem     480: .if ${MKLINKLIB} != "no"
1.178     mycroft   481:        ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
1.177     mycroft   482:            ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
1.178     mycroft   483:        mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
1.83      cgd       484:            ${DESTDIR}${LIBDIR}/lib${LIB}.so
                    485: .endif
1.12      cgd       486: .endif
1.139     tv        487: .endif
1.89      christos  488:
1.179     dmcmahil  489: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
1.89      christos  490: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168     mycroft   491: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.89      christos  492: .if !defined(UPDATE)
                    493: .PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
                    494: .endif
1.168     mycroft   495:
1.157     fredb     496: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89      christos  497: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
                    498: .endif
1.95      mycroft   499: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.188   ! tv        500:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
        !           501:                ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58      cgd       502: .endif
1.1       cgd       503: .endif
                    504:
1.188   ! tv        505: ##### Pull in related .mk logic
1.1       cgd       506: .include <bsd.man.mk>
1.57      jtc       507: .include <bsd.nls.mk>
1.91      christos  508: .include <bsd.files.mk>
1.89      christos  509: .include <bsd.inc.mk>
1.109     cjs       510: .include <bsd.links.mk>
1.24      mycroft   511: .include <bsd.dep.mk>
1.66      christos  512: .include <bsd.sys.mk>
1.117     mycroft   513:
1.188   ! tv        514: ${TARGETS}:    # ensure existence

CVSweb <webmaster@jp.NetBSD.org>