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

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

CVSweb <webmaster@jp.NetBSD.org>