[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.193

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

CVSweb <webmaster@jp.NetBSD.org>