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

1.322   ! christos    1: #      $NetBSD: bsd.lib.mk,v 1.321 2012/02/19 23:19:37 matt 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.207     thorpej     5: .include <bsd.shlib.mk>
1.219     thorpej     6: .include <bsd.gcc.mk>
1.227     lukem       7: # Pull in <bsd.sys.mk> here so we can override its .c.o rule
                      8: .include <bsd.sys.mk>
1.97      mycroft     9:
1.282     lukem      10: LIBISMODULE?=  no
1.281     lukem      11: LIBISPRIVATE?= no
1.291     mrg        12: LIBISCXX?=     no
1.281     lukem      13:
1.282     lukem      14: _LIB_PREFIX=   lib
                     15:
                     16: .if ${LIBISMODULE} != "no"
                     17: _LIB_PREFIX=   # empty
                     18: MKDEBUGLIB:=   no
                     19: MKLINT:=       no
                     20: MKPICINSTALL:= no
                     21: MKPROFILE:=    no
                     22: MKSTATICLIB:=  no
                     23: .endif
                     24:
1.281     lukem      25: .if ${LIBISPRIVATE} != "no"
1.280     lukem      26: MKDEBUGLIB:=   no
                     27: MKLINT:=       no
1.290     cube       28: MKPICINSTALL:= no
                     29: . if defined(NOSTATICLIB) && ${MKPICLIB} != "no"
                     30: MKSTATICLIB:=  no
                     31: . else
1.280     lukem      32: MKPIC:=                no
1.290     cube       33: . endif
1.280     lukem      34: MKPROFILE:=    no
                     35: .endif
                     36:
1.188     tv         37: ##### Basic targets
1.246     lukem      38: .PHONY:                checkver libinstall
1.143     erh        39: realinstall:   checkver libinstall
1.232     erh        40:
                     41: ##### LIB specific flags.
1.287     christos   42: # XXX: This is needed for programs that link with .a libraries
                     43: # Perhaps a more correct solution is to always generate _pic.a
                     44: # files or always have a shared library.
                     45: .if defined(MKPIE) && (${MKPIE} != "no")
                     46: CFLAGS+=        ${PIE_CFLAGS}
1.288     christos   47: AFLAGS+=        ${PIE_AFLAGS}
1.287     christos   48: .endif
1.1       cgd        49:
1.256     lukem      50: ##### Libraries that this may depend upon.
                     51: .if defined(LIBDPLIBS) && ${MKPIC} != "no"                             # {
                     52: .for _lib _dir in ${LIBDPLIBS}
                     53: .if !defined(LIBDO.${_lib})
1.303     christos   54: LIBDO.${_lib}!=        cd "${_dir}" && ${PRINTOBJDIR}
1.256     lukem      55: .MAKEOVERRIDES+=LIBDO.${_lib}
                     56: .endif
                     57: LDADD+=                -L${LIBDO.${_lib}} -l${_lib}
                     58: DPADD+=                ${LIBDO.${_lib}}/lib${_lib}.so
                     59: .endfor
                     60: .endif                                                                 # }
                     61:
1.188     tv         62: ##### Build and install rules
1.304     njoly      63: MKDEP_SUFFIXES?=       .o .po .pico .go .ln
1.292     pooka      64:
1.252     lukem      65: .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})             # {
1.154     simonb     66: SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
                     67: SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
1.171     christos   68: SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
1.143     erh        69:
1.295     he         70: DPADD+=        ${SHLIB_VERSION_FILE}
                     71:
1.143     erh        72: # Check for higher installed library versions.
1.145     erh        73: .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
1.201     lukem      74:        exists(${NETBSDSRCDIR}/lib/checkver)
1.143     erh        75: checkver:
1.303     christos   76:        @(cd "${.CURDIR}" && \
1.289     apb        77:            HOST_SH=${HOST_SH:Q} AWK=${TOOL_AWK:Q} \
1.239     lukem      78:            ${HOST_SH} ${NETBSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
1.195     lukem      79:                    -d ${DESTDIR}${_LIBSODIR} ${LIB})
1.173     christos   80: .endif
1.252     lukem      81: .endif                                                                 # }
1.173     christos   82:
                     83: .if !target(checkver)
1.143     erh        84: checkver:
                     85: .endif
1.173     christos   86:
1.169     thorpej    87: print-shlib-major:
1.185     tv         88: .if defined(SHLIB_MAJOR) && ${MKPIC} != "no"
1.169     thorpej    89:        @echo ${SHLIB_MAJOR}
1.173     christos   90: .else
                     91:        @false
                     92: .endif
1.169     thorpej    93:
                     94: print-shlib-minor:
1.185     tv         95: .if defined(SHLIB_MINOR) && ${MKPIC} != "no"
1.169     thorpej    96:        @echo ${SHLIB_MINOR}
1.173     christos   97: .else
                     98:        @false
                     99: .endif
1.171     christos  100:
                    101: print-shlib-teeny:
1.185     tv        102: .if defined(SHLIB_TEENY) && ${MKPIC} != "no"
1.171     christos  103:        @echo ${SHLIB_TEENY}
1.143     erh       104: .else
1.169     thorpej   105:        @false
1.173     christos  106: .endif
1.169     thorpej   107:
1.252     lukem     108: .if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)                                # {
1.173     christos  109: .if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
                    110: .if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
                    111: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
                    112: .else
                    113: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
                    114: .endif
                    115: .else
                    116: SHLIB_FULLVERSION=${SHLIB_MAJOR}
                    117: .endif
1.252     lukem     118: .endif                                                                 # }
1.1       cgd       119:
1.101     mycroft   120: # add additional suffixes not exported.
                    121: # .po is used for profiling object files.
1.304     njoly     122: # .pico is used for PIC object files.
                    123: .SUFFIXES: .out .a .ln .pico .po .go .o .s .S .c .cc .cpp .cxx .C .m .F .f .r .y .l .cl .p .h
1.118     lukem     124: .SUFFIXES: .sh .m4 .m
1.82      mikel     125:
1.86      jonathan  126:
                    127: # Set PICFLAGS to cc flags for producing position-independent code,
                    128: # if not already set.  Includes -DPIC, if required.
                    129:
1.164     simonb    130: # Data-driven table using make variables to control how shared libraries
1.86      jonathan  131: # are built for different platforms and object formats.
1.302     abs       132: # SHLIB_MAJOR, SHLIB_MINOR, SHLIB_TEENY: Major, minor, and teeny version
                    133: #                      numbers of shared library
1.164     simonb    134: # SHLIB_SOVERSION:     version number to be compiled into a shared library
                    135: #                      via -soname. Usualy ${SHLIB_MAJOR} on ELF.
1.173     christos  136: #                      NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
                    137: #                      [.${SHLIB_TEENY}]]
1.164     simonb    138: # SHLIB_SHFLAGS:       Flags to tell ${LD} to emit shared library.
1.123     jonathan  139: #                      with ELF, also set shared-lib version for ld.so.
                    140: # SHLIB_LDSTARTFILE:   support .o file, call C++ file-level constructors
                    141: # SHLIB_LDENDFILE:     support .o file, call C++ file-level destructors
1.304     njoly     142: # FPICFLAGS:           flags for ${FC} to compile .[fF] files to .pico objects.
1.271     tsutsui   143: # CPPPICFLAGS:         flags for ${CPP} to preprocess .[sS] files for ${AS}
1.205     yamt      144: # CPICFLAGS:           flags for ${CC} to compile .[cC] files to pic objects.
1.304     njoly     145: # CSHLIBFLAGS:         flags for ${CC} to compile .[cC] files to .pico objects.
1.205     yamt      146: #                      (usually includes ${CPICFLAGS})
                    147: # CAPICFLAGS:          flags for ${CC} to compiling .[Ss] files
1.107     jonathan  148: #                      (usually just ${CPPPICFLAGS} ${CPICFLAGS})
1.304     njoly     149: # APICFLAGS:           flags for ${AS} to assemble .[sS] to .pico objects.
1.86      jonathan  150:
1.252     lukem     151: .if ${MACHINE_ARCH} == "alpha"                                         # {
1.209     thorpej   152:
1.179     dmcmahil  153: FPICFLAGS ?= -fPIC
1.165     dmcmahil  154: CPICFLAGS ?= -fPIC -DPIC
1.222     lukem     155: CPPPICFLAGS?= -DPIC
1.107     jonathan  156: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    157: APICFLAGS ?=
1.209     thorpej   158:
1.308     mrg       159: .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")     # } {
1.209     thorpej   160:
1.222     lukem     161: # If you use -fPIC you need to define BIGPIC to turn on 32-bit
1.202     eeh       162: # relocations in asm code
1.179     dmcmahil  163: FPICFLAGS ?= -fPIC
1.165     dmcmahil  164: CPICFLAGS ?= -fPIC -DPIC
1.202     eeh       165: CPPPICFLAGS?= -DPIC -DBIGPIC
1.150     christos  166: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
1.203     eeh       167: APICFLAGS ?= -KPIC
1.204     fredette  168:
1.252     lukem     169: .else                                                                  # } {
1.86      jonathan  170:
1.244     skrll     171: # Platform-independent flags for NetBSD shared libraries
1.171     christos  172: SHLIB_SOVERSION=${SHLIB_FULLVERSION}
1.125     jonathan  173: SHLIB_SHFLAGS=
1.179     dmcmahil  174: FPICFLAGS ?= -fPIC
1.165     dmcmahil  175: CPICFLAGS?= -fPIC -DPIC
1.222     lukem     176: CPPPICFLAGS?= -DPIC
1.107     jonathan  177: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    178: APICFLAGS?= -k
1.86      jonathan  179:
1.252     lukem     180: .endif                                                                 # }
1.160     simonb    181:
1.205     yamt      182: .if ${MKPICLIB} != "no"
                    183: CSHLIBFLAGS+= ${CPICFLAGS}
                    184: .endif
                    185:
                    186: .if defined(CSHLIBFLAGS) && !empty(CSHLIBFLAGS)
                    187: MKSHLIBOBJS= yes
                    188: .else
                    189: MKSHLIBOBJS= no
                    190: .endif
                    191:
1.123     jonathan  192: # Platform-independent linker flags for ELF shared libraries
1.182     mrg       193: SHLIB_SOVERSION=       ${SHLIB_MAJOR}
1.282     lukem     194: SHLIB_SHFLAGS=         -Wl,-soname,${_LIB_PREFIX}${LIB}.so.${SHLIB_SOVERSION}
1.272     christos  195: SHLIB_SHFLAGS+=                -Wl,--warn-shared-textrel
1.322   ! christos  196: SHLIB_LDSTARTFILE?=    ${_GCC_CRTI} ${_GCC_CRTBEGINS}
        !           197: SHLIB_LDENDFILE?=      ${_GCC_CRTENDS} ${_GCC_CRTN}
1.86      jonathan  198:
1.82      mikel     199: CFLAGS+=       ${COPTS}
1.267     mrg       200: OBJCFLAGS+=    ${OBJCOPTS}
1.257     simonb    201: AFLAGS+=       ${COPTS}
1.179     dmcmahil  202: FFLAGS+=       ${FOPTS}
1.1       cgd       203:
1.305     darran    204: .if defined(CTFCONVERT)
                    205: .if defined(CFLAGS) && !empty(CFLAGS:M*-g*)
                    206: CTFFLAGS+=     -g
                    207: .endif
                    208: .endif
                    209:
1.1       cgd       210: .c.o:
1.238     lukem     211:        ${_MKTARGET_COMPILE}
1.263     dsl       212:        ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    213: .if defined(CTFCONVERT)
                    214:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    215: .endif
1.270     martin    216: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.320     christos  217:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  218: .endif
1.1       cgd       219:
                    220: .c.po:
1.238     lukem     221:        ${_MKTARGET_COMPILE}
1.263     dsl       222:        ${COMPILE.c} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
1.305     darran    223: .if defined(CTFCONVERT)
                    224:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    225: .endif
1.270     martin    226: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.320     christos  227:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  228: .endif
1.17      mycroft   229:
1.266     christos  230: .c.go:
                    231:        ${_MKTARGET_COMPILE}
                    232:        ${COMPILE.c} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
                    233:
1.304     njoly     234: .c.pico:
1.238     lukem     235:        ${_MKTARGET_COMPILE}
1.263     dsl       236:        ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
1.270     martin    237: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.320     christos  238:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  239: .endif
1.27      pk        240:
1.223     lukem     241: .cc.o .cpp.o .cxx.o .C.o:
1.238     lukem     242:        ${_MKTARGET_COMPILE}
1.263     dsl       243:        ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.270     martin    244: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.320     christos  245:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  246: .endif
1.17      mycroft   247:
1.266     christos  248: .cc.po .cpp.po .cxx.po .C.po:
1.238     lukem     249:        ${_MKTARGET_COMPILE}
1.263     dsl       250:        ${COMPILE.cc} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
1.270     martin    251: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.320     christos  252:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  253: .endif
1.28      cgd       254:
1.266     christos  255: .cc.go .cpp.go .cxx.go .C.go:
                    256:        ${_MKTARGET_COMPILE}
                    257:        ${COMPILE.cc} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
                    258:
1.304     njoly     259: .cc.pico .cpp.pico .cxx.pico .C.pico:
1.238     lukem     260:        ${_MKTARGET_COMPILE}
1.263     dsl       261:        ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
1.270     martin    262: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.320     christos  263:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  264: .endif
1.118     lukem     265:
1.179     dmcmahil  266: .f.o:
1.238     lukem     267:        ${_MKTARGET_COMPILE}
1.263     dsl       268:        ${COMPILE.f} ${.IMPSRC} -o ${.TARGET}
1.305     darran    269: .if defined(CTFCONVERT)
                    270:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    271: .endif
1.263     dsl       272: .if !defined(FOPTS) || empty(FOPTS:M*-g*)
1.320     christos  273:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.179     dmcmahil  274: .endif
                    275:
                    276: .f.po:
1.238     lukem     277:        ${_MKTARGET_COMPILE}
1.263     dsl       278:        ${COMPILE.f} ${PROFFLAGS} -pg ${.IMPSRC} -o ${.TARGET}
1.305     darran    279: .if defined(CTFCONVERT)
                    280:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    281: .endif
1.263     dsl       282: .if !defined(FOPTS) || empty(FOPTS:M*-g*)
1.320     christos  283:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.179     dmcmahil  284: .endif
                    285:
1.266     christos  286: .f.go:
                    287:        ${_MKTARGET_COMPILE}
                    288:        ${COMPILE.f} ${DEBUGFLAGS} -g ${.IMPSRC} -o ${.TARGET}
                    289:
1.304     njoly     290: .f.pico:
1.238     lukem     291:        ${_MKTARGET_COMPILE}
1.263     dsl       292:        ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    293: .if !defined(FOPTS) || empty(FOPTS:M*-g*)
1.320     christos  294:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.179     dmcmahil  295: .endif
                    296:
                    297: .f.ln:
1.238     lukem     298:        ${_MKTARGET_COMPILE}
1.217     wiz       299:        @echo Skipping lint for Fortran libraries.
1.179     dmcmahil  300:
1.118     lukem     301: .m.o:
1.238     lukem     302:        ${_MKTARGET_COMPILE}
1.267     mrg       303:        ${COMPILE.m} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    304: .if defined(CTFCONVERT)
                    305:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    306: .endif
1.263     dsl       307: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
1.320     christos  308:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  309: .endif
1.118     lukem     310:
                    311: .m.po:
1.238     lukem     312:        ${_MKTARGET_COMPILE}
1.267     mrg       313:        ${COMPILE.m} ${PROFFLAGS} -pg ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    314: .if defined(CTFCONVERT)
                    315:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    316: .endif
1.263     dsl       317: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
1.320     christos  318:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  319: .endif
1.118     lukem     320:
1.266     christos  321: .m.go:
                    322:        ${_MKTARGET_COMPILE}
1.267     mrg       323:        ${COMPILE.m} ${DEBUGFLAGS} -g ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.266     christos  324: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
1.320     christos  325:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.266     christos  326: .endif
                    327:
1.304     njoly     328: .m.pico:
1.238     lukem     329:        ${_MKTARGET_COMPILE}
1.267     mrg       330:        ${COMPILE.m} ${CSHLIBFLAGS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.263     dsl       331: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
1.320     christos  332:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.153     christos  333: .endif
1.1       cgd       334:
1.251     lukem     335: .s.o:
1.238     lukem     336:        ${_MKTARGET_COMPILE}
1.263     dsl       337:        ${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    338: .if defined(CTFCONVERT)
                    339:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    340: .endif
1.320     christos  341:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.1       cgd       342:
1.251     lukem     343: .S.o:
                    344:        ${_MKTARGET_COMPILE}
1.263     dsl       345:        ${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    346: .if defined(CTFCONVERT)
                    347:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    348: .endif
1.320     christos  349:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.251     lukem     350:
                    351: .s.po:
                    352:        ${_MKTARGET_COMPILE}
1.263     dsl       353:        ${COMPILE.s} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    354: .if defined(CTFCONVERT)
                    355:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    356: .endif
1.320     christos  357:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.251     lukem     358:
                    359: .S.po:
1.238     lukem     360:        ${_MKTARGET_COMPILE}
1.263     dsl       361:        ${COMPILE.S} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    362: .if defined(CTFCONVERT)
                    363:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    364: .endif
1.320     christos  365:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.1       cgd       366:
1.266     christos  367: .s.go:
                    368:        ${_MKTARGET_COMPILE}
                    369:        ${COMPILE.s} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
                    370:
                    371: .S.go:
                    372:        ${_MKTARGET_COMPILE}
                    373:        ${COMPILE.S} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
                    374:
1.304     njoly     375: .s.pico:
1.251     lukem     376:        ${_MKTARGET_COMPILE}
1.263     dsl       377:        ${COMPILE.s} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.320     christos  378:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.251     lukem     379:
1.304     njoly     380: .S.pico:
1.238     lukem     381:        ${_MKTARGET_COMPILE}
1.263     dsl       382:        ${COMPILE.S} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.320     christos  383:        ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
1.27      pk        384:
1.252     lukem     385: .if defined(LIB)                                                       # {
1.234     lukem     386: .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    387:        || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
1.130     tv        388: _LIBS=lib${LIB}.a
                    389: .else
                    390: _LIBS=
                    391: .endif
1.58      cgd       392:
1.321     matt      393: .if ${LIBISPRIVATE} != "no" \
                    394:    && (defined(USE_COMBINE) && ${USE_COMBINE} == "yes" \
                    395:    && !defined(NOCOMBINE))                                             # {
                    396: .for f in ${SRCS:N*.h:N*.sh:C/\.[yl]$/.c/g}
                    397: COMBINEFLAGS.${LIB}.$f := ${CPPFLAGS.$f:D1} ${CPUFLAGS.$f:D2} ${COPTS.$f:D3} ${OBJCOPTS.$f:D4} ${CXXFLAGS.$f:D5}
                    398: .if empty(COMBINEFLAGS.${LIB}.${f}) && !defined(NOCOMBINE.$f)
                    399: COMBINESRCS+=  ${f}
                    400: NODPSRCS+=     ${f}
                    401: .else
                    402: OBJS+=         ${f:R:S/$/.o/}
                    403: .endif
                    404: .endfor
                    405:
                    406: .if !empty(COMBINESRCS)
                    407: OBJS+=         lib${LIB}_combine.o
                    408: lib${LIB}_combine.o: ${COMBINESRCS}
                    409:        ${_MKTARGET_COMPILE}
                    410:        ${COMPILE.c} -MD --combine ${.ALLSRC} -o ${.TARGET}
                    411: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
                    412:        ${OBJCOPY} -x ${.TARGET}
                    413: .endif
                    414:
                    415: CLEANFILES+=   lib${LIB}_combine.d
                    416:
                    417: .if exists("lib${LIB}_combine.d")
                    418: .include "lib${LIB}_combine.d"
                    419: .endif
                    420: .endif   # empty(XSRCS.${LIB})
                    421: .else                                                  # } {
1.167     matt      422: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.321     matt      423: .endif                                                 # }
1.158     christos  424:
1.255     thorpej   425: STOBJS+=${OBJS}
                    426:
1.280     lukem     427: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
                    428:
1.281     lukem     429: .if ${LIBISPRIVATE} != "no"
1.252     lukem     430: # No installation is required
                    431: libinstall::
1.306     lukem     432: .endif
1.252     lukem     433:
1.268     lukem     434: .if ${MKDEBUGLIB} != "no"
1.266     christos  435: _LIBS+=lib${LIB}_g.a
                    436: GOBJS+=${OBJS:.o=.go}
                    437: DEBUGFLAGS?=-DDEBUG
                    438: .endif
                    439:
1.149     lukem     440: .if ${MKPROFILE} != "no"
1.130     tv        441: _LIBS+=lib${LIB}_p.a
1.167     matt      442: POBJS+=${OBJS:.o=.po}
1.262     christos  443: PROFFLAGS?=-DGPROF -DPROF
1.1       cgd       444: .endif
                    445:
1.252     lukem     446: .if ${MKPIC} != "no"                                                   # {
1.160     simonb    447: .if ${MKPICLIB} == "no"
1.205     yamt      448: .if ${MKSHLIBOBJS} != "no"
                    449: # make _pic.a, which isn't really pic,
                    450: # since it's needed for making shared lib.
                    451: # but don't install it.
                    452: SOLIB=lib${LIB}_pic.a
1.304     njoly     453: SOBJS+=${OBJS:.o=.pico}
1.205     yamt      454: .else
1.160     simonb    455: SOLIB=lib${LIB}.a
1.205     yamt      456: .endif
1.160     simonb    457: .else
                    458: SOLIB=lib${LIB}_pic.a
                    459: _LIBS+=${SOLIB}
1.304     njoly     460: SOBJS+=${OBJS:.o=.pico}
1.160     simonb    461: .endif
1.171     christos  462: .if defined(SHLIB_FULLVERSION)
1.307     lukem     463: _LIB.so:=lib${LIB}.so.${SHLIB_FULLVERSION}
1.308     mrg       464: .if ${MKDEBUG} != "no"
1.307     lukem     465: _LIB.debug:=${_LIB.so}.debug
                    466: .endif
1.171     christos  467: _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
1.27      pk        468: .endif
1.252     lukem     469: .endif                                                                 # }
1.27      pk        470:
1.279     lukem     471: .if ${MKLINT} != "no" && !empty(LOBJS)
1.58      cgd       472: _LIBS+=llib-l${LIB}.ln
1.215     christos  473: .endif
1.27      pk        474:
1.234     lukem     475: ALLOBJS=
                    476: .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    477:        || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
1.255     thorpej   478: ALLOBJS+=${STOBJS}
1.179     dmcmahil  479: .endif
1.234     lukem     480: ALLOBJS+=${POBJS} ${SOBJS}
1.279     lukem     481: .if ${MKLINT} != "no" && !empty(LOBJS)
1.179     dmcmahil  482: ALLOBJS+=${LOBJS}
1.216     christos  483: .endif
1.252     lukem     484: .else  # !defined(LIB)                                                 # } {
1.216     christos  485: LOBJS=
                    486: SOBJS=
1.252     lukem     487: .endif # !defined(LIB)                                                 # }
1.186     tv        488:
1.254     lukem     489: _YLSRCS=       ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
1.253     christos  490:
                    491: .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
1.158     christos  492:
1.307     lukem     493: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} ${_LIB.debug}
1.1       cgd       494:
1.296     perry     495: MKARZERO?=no
                    496:
                    497: .if ${MKARZERO} == "yes"
                    498: _ARFL=crsD
1.297     perry     499: _ARRANFL=sD
1.296     perry     500: _INSTRANLIB=
                    501: .else
                    502: _ARFL=crs
1.297     perry     503: _ARRANFL=s
1.296     perry     504: _INSTRANLIB=${empty(PRESERVE):?-a "${RANLIB} -t":}
                    505: .endif
                    506:
1.293     pooka     507: # If you change this, please consider reflecting the change in
                    508: # the override in sys/rump/Makefile.rump.
1.243     rtr       509: .if !target(__archivebuild)
1.90      christos  510: __archivebuild: .USE
1.238     lukem     511:        ${_MKTARGET_BUILD}
1.236     lukem     512:        rm -f ${.TARGET}
1.296     perry     513:        ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.243     rtr       514: .endif
1.89      christos  515:
1.243     rtr       516: .if !target(__archiveinstall)
1.89      christos  517: __archiveinstall: .USE
1.238     lukem     518:        ${_MKTARGET_INSTALL}
1.198     lukem     519:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.296     perry     520:            ${_INSTRANLIB} ${.ALLSRC} ${.TARGET}
1.243     rtr       521: .endif
1.89      christos  522:
1.197     mycroft   523: __archivesymlinkpic: .USE
1.238     lukem     524:        ${_MKTARGET_INSTALL}
1.264     jwise     525:        ${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET}
1.197     mycroft   526:
1.253     christos  527: DPSRCS+=       ${_YLSRCS}
                    528: CLEANFILES+=   ${_YLSRCS}
1.230     lukem     529:
1.266     christos  530: ${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
1.103     mycroft   531:
1.255     thorpej   532: lib${LIB}.a:: ${STOBJS} __archivebuild
1.1       cgd       533:
1.89      christos  534: lib${LIB}_p.a:: ${POBJS} __archivebuild
1.1       cgd       535:
1.89      christos  536: lib${LIB}_pic.a:: ${SOBJS} __archivebuild
1.27      pk        537:
1.266     christos  538: lib${LIB}_g.a:: ${GOBJS} __archivebuild
                    539:
1.235     lukem     540:
                    541: _LIBLDOPTS=
                    542: .if ${SHLIBDIR} != "/usr/lib"
1.314     joerg     543: _LIBLDOPTS+=   -Wl,-rpath,${SHLIBDIR} \
1.313     joerg     544:                -L=${SHLIBDIR}
1.235     lukem     545: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.314     joerg     546: _LIBLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
1.313     joerg     547:                -L=${SHLIBINSTALLDIR}
1.235     lukem     548: .endif
                    549:
1.277     christos  550: # gcc -shared now adds -lc automatically. For libraries other than libc and
                    551: # libgcc* we add as a dependency the installed shared libc. For libc and
                    552: # libgcc* we avoid adding libc as a dependency by using -nostdlib. Note that
                    553: # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not
                    554: # to add standard libraries, not the linker.
1.276     christos  555: .if !defined(LIB)
1.312     matt      556: .if !empty(LIBC_SO)
1.274     christos  557: DPLIBC ?= ${DESTDIR}${LIBC_SO}
1.312     matt      558: .endif
1.276     christos  559: .else
1.278     simonb    560: .if ${LIB} != "c" && ${LIB:Mgcc*} == ""
1.312     matt      561: .if !empty(LIBC_SO)
1.276     christos  562: DPLIBC ?= ${DESTDIR}${LIBC_SO}
1.312     matt      563: .endif
1.277     christos  564: .else
1.278     simonb    565: LDLIBC ?= -nodefaultlibs
                    566: .if ${LIB} == "c"
1.318     mrg       567: LDADD+= -lgcc
1.278     simonb    568: .endif
1.276     christos  569: .endif
1.274     christos  570: .endif
                    571:
1.291     mrg       572: .if ${LIBISCXX} != "no"
                    573: LIBCC:=        ${CXX}
                    574: .else
                    575: LIBCC:=        ${CC}
                    576: .endif
                    577:
1.300     uebayasi  578: _LDADD.lib${LIB}=      ${LDADD} ${LDADD.lib${LIB}}
                    579: _LDFLAGS.lib${LIB}=    ${LDFLAGS} ${LDFLAGS.lib${LIB}}
                    580:
1.274     christos  581: lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} ${DPLIBC} \
1.88      cgd       582:     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.238     lukem     583:        ${_MKTARGET_BUILD}
1.236     lukem     584:        rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
1.300     uebayasi  585:        ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${_LDFLAGS.lib${LIB}} \
1.277     christos  586:            -o ${.TARGET} ${_LIBLDOPTS} \
1.300     uebayasi  587:            -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${_LDADD.lib${LIB}}
1.196     lukem     588: #  We don't use INSTALL_SYMLINK here because this is just
                    589: #  happening inside the build directory/objdir. XXX Why does
                    590: #  this spend so much effort on libraries that aren't live??? XXX
1.284     lukem     591: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
                    592:     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.241     matt      593:        ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
1.177     mycroft   594:        mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
1.283     lukem     595: .endif
1.241     matt      596:        ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
1.177     mycroft   597:        mv -f lib${LIB}.so.tmp lib${LIB}.so
1.286     joerg     598: .if ${MKSTRIPIDENT} != "no"
                    599:        ${OBJCOPY} -R .ident ${.TARGET}
                    600: .endif
1.35      pk        601:
1.307     lukem     602: .if defined(_LIB.debug)
                    603: ${_LIB.debug}: ${_LIB.so}
                    604:        ${_MKTARGET_CREATE}
1.309     lukem     605:        (  ${OBJCOPY} --only-keep-debug ${_LIB.so} ${_LIB.debug} \
                    606:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    607:                --add-gnu-debuglink=${_LIB.debug} ${_LIB.so} \
                    608:        ) || (rm -f ${_LIB.debug}; false)
1.307     lukem     609: .endif
                    610:
1.252     lukem     611: .if !empty(LOBJS)                                                      # {
1.103     mycroft   612: LLIBS?=                -lc
1.58      cgd       613: llib-l${LIB}.ln: ${LOBJS}
1.238     lukem     614:        ${_MKTARGET_COMPILE}
1.236     lukem     615:        rm -f llib-l${LIB}.ln
1.206     thorpej   616: .if defined(DESTDIR)
1.228     lukem     617:        ${LINT} -C${LIB} ${.ALLSRC} -L${DESTDIR}/usr/libdata ${LLIBS}
1.206     thorpej   618: .else
1.228     lukem     619:        ${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.206     thorpej   620: .endif
1.252     lukem     621: .endif                                                                 # }
1.1       cgd       622:
1.280     lukem     623: lint: ${LOBJS}
                    624: .if defined(LOBJS) && !empty(LOBJS)
                    625:        ${LINT} ${LINTFLAGS} ${LOBJS}
                    626: .endif
                    627:
1.317     apb       628: # If the number of entries in CLEANFILES is too large, then the
                    629: # commands in bsd.clean.mk encounter errors like "exec(/bin/sh)
                    630: # failed (Argument list too long)".  Avoid that by splitting the
                    631: # files to clean into several lists using different variable names.
                    632: # __cleanuse is an internal target in bsd.clean.mk; the way we
                    633: # use it here mimics the way it's used by the clean target in
                    634: # bsd.clean.mk.
                    635: #
                    636: clean: libclean1 libclean2 libclean3 libclean4 libclean5
                    637: libclean1: .PHONY .MADE __cleanuse LIBCLEANFILES1
                    638: libclean2: .PHONY .MADE __cleanuse LIBCLEANFILES2
                    639: libclean3: .PHONY .MADE __cleanuse LIBCLEANFILES3
                    640: libclean4: .PHONY .MADE __cleanuse LIBCLEANFILES4
                    641: libclean5: .PHONY .MADE __cleanuse LIBCLEANFILES5
1.316     apb       642: CLEANFILES+= a.out [Ee]rrs mklog core *.core
1.317     apb       643: LIBCLEANFILES1+= lib${LIB}.a   ${STOBJS} ${STOBJS:=.tmp}
                    644: LIBCLEANFILES2+= lib${LIB}_p.a ${POBJS}  ${POBJS:=.tmp}
                    645: LIBCLEANFILES3+= lib${LIB}_g.a ${GOBJS}  ${GOBJS:=.tmp}
                    646: LIBCLEANFILES4+= lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${_LIB.debug}
                    647: LIBCLEANFILES4+= ${SOBJS} ${SOBJS:=.tmp}
                    648: LIBCLEANFILES5+= llib-l${LIB}.ln ${LOBJS}
1.252     lukem     649:
                    650: .if !target(libinstall)                                                        # {
1.148     lukem     651: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139     tv        652: libinstall::
                    653:
1.234     lukem     654: .if ${MKLINKLIB} != "no" && ${MKSTATICLIB} != "no"
1.89      christos  655: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168     mycroft   656: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.197     mycroft   657:
1.269     dbj       658: .if ${MKUPDATE} == "no"
1.197     mycroft   659: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
                    660: ${DESTDIR}${LIBDIR}/lib${LIB}.a! .MADE
1.89      christos  661: .endif
1.197     mycroft   662: ${DESTDIR}${LIBDIR}/lib${LIB}.a! lib${LIB}.a __archiveinstall
                    663: .else
1.157     fredb     664: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89      christos  665: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
                    666: .endif
                    667: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130     tv        668: .endif
1.197     mycroft   669: .endif
1.89      christos  670:
1.149     lukem     671: .if ${MKPROFILE} != "no"
1.89      christos  672: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168     mycroft   673: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.197     mycroft   674:
1.269     dbj       675: .if ${MKUPDATE} == "no"
1.197     mycroft   676: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
                    677: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! .MADE
1.32      pk        678: .endif
1.197     mycroft   679: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! lib${LIB}_p.a __archiveinstall
                    680: .else
1.157     fredb     681: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89      christos  682: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
                    683: .endif
                    684: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
                    685: .endif
1.197     mycroft   686: .endif
1.89      christos  687:
1.268     lukem     688: .if ${MKDEBUGLIB} != "no"
1.266     christos  689: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
                    690: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
                    691:
1.269     dbj       692: .if ${MKUPDATE} == "no"
1.266     christos  693: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
                    694: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! .MADE
                    695: .endif
                    696: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! lib${LIB}_g.a __archiveinstall
                    697: .else
                    698: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
                    699: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: .MADE
                    700: .endif
                    701: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: lib${LIB}_g.a __archiveinstall
                    702: .endif
                    703: .endif
                    704:
1.149     lukem     705: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168     mycroft   706: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160     simonb    707: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.197     mycroft   708:
1.269     dbj       709: .if ${MKUPDATE} == "no"
1.197     mycroft   710: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
                    711: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! .MADE
1.89      christos  712: .endif
1.197     mycroft   713: .if ${MKPICLIB} == "no"
                    714: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}.a __archivesymlinkpic
                    715: .else
                    716: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}_pic.a __archiveinstall
                    717: .endif
                    718: .else
1.157     fredb     719: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89      christos  720: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33      pk        721: .endif
1.160     simonb    722: .if ${MKPICLIB} == "no"
1.197     mycroft   723: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}.a __archivesymlinkpic
1.160     simonb    724: .else
1.89      christos  725: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160     simonb    726: .endif
1.89      christos  727: .endif
1.197     mycroft   728: .endif
1.89      christos  729:
1.171     christos  730: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
1.282     lukem     731: _LIB_SO_TGT=           ${DESTDIR}${_LIBSODIR}/${_LIB_PREFIX}${LIB}.so
                    732: _LIB_SO_TGTLIBDIR=        ${DESTDIR}${LIBDIR}/${_LIB_PREFIX}${LIB}.so
                    733:
                    734: libinstall:: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
                    735: .PRECIOUS: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
1.197     mycroft   736:
1.269     dbj       737: .if ${MKUPDATE} == "no"
1.197     mycroft   738: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
1.282     lukem     739: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! .MADE
1.89      christos  740: .endif
1.282     lukem     741: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
1.197     mycroft   742: .else
1.171     christos  743: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
1.282     lukem     744: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: .MADE
1.89      christos  745: .endif
1.282     lukem     746: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.197     mycroft   747: .endif
1.238     lukem     748:        ${_MKTARGET_INSTALL}
1.188     tv        749:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.264     jwise     750:                ${.ALLSRC} ${.TARGET}
1.195     lukem     751: .if ${_LIBSODIR} != ${LIBDIR}
1.282     lukem     752:        ${INSTALL_SYMLINK} -l r \
                    753:                ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                    754:                ${_LIB_SO_TGTLIBDIR}.${SHLIB_FULLVERSION}
1.195     lukem     755: .endif
1.284     lukem     756: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
                    757:     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.264     jwise     758:        ${INSTALL_SYMLINK} \
1.284     lukem     759:                ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
1.282     lukem     760:                ${_LIB_SO_TGT}.${SHLIB_MAJOR}
1.195     lukem     761: .if ${_LIBSODIR} != ${LIBDIR}
1.282     lukem     762:        ${INSTALL_SYMLINK} -l r \
                    763:                ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                    764:                ${_LIB_SO_TGTLIBDIR}.${SHLIB_MAJOR}
1.195     lukem     765: .endif
1.284     lukem     766: .endif
1.148     lukem     767: .if ${MKLINKLIB} != "no"
1.264     jwise     768:        ${INSTALL_SYMLINK} \
1.284     lukem     769:                ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
1.282     lukem     770:                ${_LIB_SO_TGT}
1.195     lukem     771: .if ${_LIBSODIR} != ${LIBDIR}
1.282     lukem     772:        ${INSTALL_SYMLINK} -l r \
                    773:                ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                    774:                ${_LIB_SO_TGTLIBDIR}
1.195     lukem     775: .endif
1.83      cgd       776: .endif
1.12      cgd       777: .endif
1.89      christos  778:
1.307     lukem     779: .if defined(_LIB.debug)
                    780: libinstall:: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}
                    781: .PRECIOUS: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}
                    782:
                    783: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}: ${_LIB.debug}
                    784:        ${_MKTARGET_INSTALL}
                    785:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    786:                ${.ALLSRC} ${.TARGET}
                    787: .endif
                    788:
1.279     lukem     789: .if ${MKLINT} != "no" && !empty(LOBJS)
1.89      christos  790: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168     mycroft   791: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.197     mycroft   792:
1.269     dbj       793: .if ${MKUPDATE} == "no"
1.197     mycroft   794: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
                    795: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! .MADE
1.89      christos  796: .endif
1.197     mycroft   797: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! llib-l${LIB}.ln
                    798: .else
1.157     fredb     799: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89      christos  800: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
                    801: .endif
1.95      mycroft   802: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.197     mycroft   803: .endif
1.238     lukem     804:        ${_MKTARGET_INSTALL}
1.188     tv        805:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.264     jwise     806:                ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58      cgd       807: .endif
1.252     lukem     808: .endif # !target(libinstall)                                           # }
1.1       cgd       809:
1.188     tv        810: ##### Pull in related .mk logic
1.298     apb       811: LINKSOWN?= ${LIBOWN}
                    812: LINKSGRP?= ${LIBGRP}
                    813: LINKSMODE?= ${LIBMODE}
1.1       cgd       814: .include <bsd.man.mk>
1.57      jtc       815: .include <bsd.nls.mk>
1.91      christos  816: .include <bsd.files.mk>
1.89      christos  817: .include <bsd.inc.mk>
1.109     cjs       818: .include <bsd.links.mk>
1.24      mycroft   819: .include <bsd.dep.mk>
1.315     joerg     820: .include <bsd.clang-analyze.mk>
1.316     apb       821: .include <bsd.clean.mk>
1.117     mycroft   822:
1.188     tv        823: ${TARGETS}:    # ensure existence

CVSweb <webmaster@jp.NetBSD.org>