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

1.326   ! christos    1: #      $NetBSD: bsd.lib.mk,v 1.325 2012/11/13 22:30:38 pooka 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}
                     67: DPADD+=                ${LIBDO.${_lib}}/lib${_lib}.so
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.195     lukem      89:                    -d ${DESTDIR}${_LIBSODIR} ${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.282     lukem     204: SHLIB_SHFLAGS=         -Wl,-soname,${_LIB_PREFIX}${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.252     lukem     395: .if defined(LIB)                                                       # {
1.234     lukem     396: .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    397:        || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
1.130     tv        398: _LIBS=lib${LIB}.a
                    399: .else
                    400: _LIBS=
                    401: .endif
1.58      cgd       402:
1.321     matt      403: .if ${LIBISPRIVATE} != "no" \
                    404:    && (defined(USE_COMBINE) && ${USE_COMBINE} == "yes" \
                    405:    && !defined(NOCOMBINE))                                             # {
                    406: .for f in ${SRCS:N*.h:N*.sh:C/\.[yl]$/.c/g}
                    407: COMBINEFLAGS.${LIB}.$f := ${CPPFLAGS.$f:D1} ${CPUFLAGS.$f:D2} ${COPTS.$f:D3} ${OBJCOPTS.$f:D4} ${CXXFLAGS.$f:D5}
                    408: .if empty(COMBINEFLAGS.${LIB}.${f}) && !defined(NOCOMBINE.$f)
                    409: COMBINESRCS+=  ${f}
                    410: NODPSRCS+=     ${f}
                    411: .else
                    412: OBJS+=         ${f:R:S/$/.o/}
                    413: .endif
                    414: .endfor
                    415:
                    416: .if !empty(COMBINESRCS)
                    417: OBJS+=         lib${LIB}_combine.o
                    418: lib${LIB}_combine.o: ${COMBINESRCS}
                    419:        ${_MKTARGET_COMPILE}
                    420:        ${COMPILE.c} -MD --combine ${.ALLSRC} -o ${.TARGET}
                    421: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
                    422:        ${OBJCOPY} -x ${.TARGET}
                    423: .endif
                    424:
                    425: CLEANFILES+=   lib${LIB}_combine.d
                    426:
                    427: .if exists("lib${LIB}_combine.d")
                    428: .include "lib${LIB}_combine.d"
                    429: .endif
                    430: .endif   # empty(XSRCS.${LIB})
                    431: .else                                                  # } {
1.167     matt      432: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.321     matt      433: .endif                                                 # }
1.158     christos  434:
1.255     thorpej   435: STOBJS+=${OBJS}
                    436:
1.280     lukem     437: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
                    438:
1.281     lukem     439: .if ${LIBISPRIVATE} != "no"
1.252     lukem     440: # No installation is required
                    441: libinstall::
1.306     lukem     442: .endif
1.252     lukem     443:
1.268     lukem     444: .if ${MKDEBUGLIB} != "no"
1.266     christos  445: _LIBS+=lib${LIB}_g.a
                    446: GOBJS+=${OBJS:.o=.go}
                    447: DEBUGFLAGS?=-DDEBUG
                    448: .endif
                    449:
1.149     lukem     450: .if ${MKPROFILE} != "no"
1.130     tv        451: _LIBS+=lib${LIB}_p.a
1.167     matt      452: POBJS+=${OBJS:.o=.po}
1.262     christos  453: PROFFLAGS?=-DGPROF -DPROF
1.1       cgd       454: .endif
                    455:
1.252     lukem     456: .if ${MKPIC} != "no"                                                   # {
1.160     simonb    457: .if ${MKPICLIB} == "no"
1.205     yamt      458: .if ${MKSHLIBOBJS} != "no"
                    459: # make _pic.a, which isn't really pic,
                    460: # since it's needed for making shared lib.
                    461: # but don't install it.
                    462: SOLIB=lib${LIB}_pic.a
1.304     njoly     463: SOBJS+=${OBJS:.o=.pico}
1.205     yamt      464: .else
1.160     simonb    465: SOLIB=lib${LIB}.a
1.205     yamt      466: .endif
1.160     simonb    467: .else
                    468: SOLIB=lib${LIB}_pic.a
                    469: _LIBS+=${SOLIB}
1.304     njoly     470: SOBJS+=${OBJS:.o=.pico}
1.160     simonb    471: .endif
1.171     christos  472: .if defined(SHLIB_FULLVERSION)
1.307     lukem     473: _LIB.so:=lib${LIB}.so.${SHLIB_FULLVERSION}
1.308     mrg       474: .if ${MKDEBUG} != "no"
1.307     lukem     475: _LIB.debug:=${_LIB.so}.debug
                    476: .endif
1.171     christos  477: _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
1.27      pk        478: .endif
1.252     lukem     479: .endif                                                                 # }
1.27      pk        480:
1.279     lukem     481: .if ${MKLINT} != "no" && !empty(LOBJS)
1.58      cgd       482: _LIBS+=llib-l${LIB}.ln
1.215     christos  483: .endif
1.27      pk        484:
1.234     lukem     485: ALLOBJS=
                    486: .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    487:        || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
1.255     thorpej   488: ALLOBJS+=${STOBJS}
1.179     dmcmahil  489: .endif
1.234     lukem     490: ALLOBJS+=${POBJS} ${SOBJS}
1.279     lukem     491: .if ${MKLINT} != "no" && !empty(LOBJS)
1.179     dmcmahil  492: ALLOBJS+=${LOBJS}
1.216     christos  493: .endif
1.252     lukem     494: .else  # !defined(LIB)                                                 # } {
1.216     christos  495: LOBJS=
                    496: SOBJS=
1.252     lukem     497: .endif # !defined(LIB)                                                 # }
1.186     tv        498:
1.254     lukem     499: _YLSRCS=       ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
1.253     christos  500:
                    501: .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
1.158     christos  502:
1.307     lukem     503: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} ${_LIB.debug}
1.1       cgd       504:
1.296     perry     505: MKARZERO?=no
                    506:
                    507: .if ${MKARZERO} == "yes"
                    508: _ARFL=crsD
1.297     perry     509: _ARRANFL=sD
1.296     perry     510: _INSTRANLIB=
                    511: .else
                    512: _ARFL=crs
1.297     perry     513: _ARRANFL=s
1.296     perry     514: _INSTRANLIB=${empty(PRESERVE):?-a "${RANLIB} -t":}
                    515: .endif
                    516:
1.293     pooka     517: # If you change this, please consider reflecting the change in
                    518: # the override in sys/rump/Makefile.rump.
1.243     rtr       519: .if !target(__archivebuild)
1.90      christos  520: __archivebuild: .USE
1.238     lukem     521:        ${_MKTARGET_BUILD}
1.236     lukem     522:        rm -f ${.TARGET}
1.296     perry     523:        ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.243     rtr       524: .endif
1.89      christos  525:
1.243     rtr       526: .if !target(__archiveinstall)
1.89      christos  527: __archiveinstall: .USE
1.238     lukem     528:        ${_MKTARGET_INSTALL}
1.198     lukem     529:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.296     perry     530:            ${_INSTRANLIB} ${.ALLSRC} ${.TARGET}
1.243     rtr       531: .endif
1.89      christos  532:
1.197     mycroft   533: __archivesymlinkpic: .USE
1.238     lukem     534:        ${_MKTARGET_INSTALL}
1.264     jwise     535:        ${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET}
1.197     mycroft   536:
1.253     christos  537: DPSRCS+=       ${_YLSRCS}
                    538: CLEANFILES+=   ${_YLSRCS}
1.230     lukem     539:
1.266     christos  540: ${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
1.103     mycroft   541:
1.255     thorpej   542: lib${LIB}.a:: ${STOBJS} __archivebuild
1.1       cgd       543:
1.89      christos  544: lib${LIB}_p.a:: ${POBJS} __archivebuild
1.1       cgd       545:
1.89      christos  546: lib${LIB}_pic.a:: ${SOBJS} __archivebuild
1.27      pk        547:
1.266     christos  548: lib${LIB}_g.a:: ${GOBJS} __archivebuild
                    549:
1.235     lukem     550:
                    551: _LIBLDOPTS=
                    552: .if ${SHLIBDIR} != "/usr/lib"
1.324     joerg     553: _LIBLDOPTS+=   -Wl,-rpath,${SHLIBDIR} \
                    554:                -L=${SHLIBDIR}
                    555: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
                    556: _LIBLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
                    557:                -L=${SHLIBINSTALLDIR}
1.235     lukem     558: .endif
                    559:
1.277     christos  560: # gcc -shared now adds -lc automatically. For libraries other than libc and
                    561: # libgcc* we add as a dependency the installed shared libc. For libc and
                    562: # libgcc* we avoid adding libc as a dependency by using -nostdlib. Note that
                    563: # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not
                    564: # to add standard libraries, not the linker.
1.276     christos  565: .if !defined(LIB)
1.312     matt      566: .if !empty(LIBC_SO)
1.274     christos  567: DPLIBC ?= ${DESTDIR}${LIBC_SO}
1.312     matt      568: .endif
1.276     christos  569: .else
1.278     simonb    570: .if ${LIB} != "c" && ${LIB:Mgcc*} == ""
1.312     matt      571: .if !empty(LIBC_SO)
1.276     christos  572: DPLIBC ?= ${DESTDIR}${LIBC_SO}
1.312     matt      573: .endif
1.277     christos  574: .else
1.278     simonb    575: LDLIBC ?= -nodefaultlibs
                    576: .if ${LIB} == "c"
1.318     mrg       577: LDADD+= -lgcc
1.278     simonb    578: .endif
1.276     christos  579: .endif
1.274     christos  580: .endif
                    581:
1.291     mrg       582: .if ${LIBISCXX} != "no"
                    583: LIBCC:=        ${CXX}
                    584: .else
                    585: LIBCC:=        ${CC}
                    586: .endif
                    587:
1.300     uebayasi  588: _LDADD.lib${LIB}=      ${LDADD} ${LDADD.lib${LIB}}
                    589: _LDFLAGS.lib${LIB}=    ${LDFLAGS} ${LDFLAGS.lib${LIB}}
                    590:
1.274     christos  591: lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} ${DPLIBC} \
1.88      cgd       592:     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.238     lukem     593:        ${_MKTARGET_BUILD}
1.236     lukem     594:        rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
1.300     uebayasi  595:        ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${_LDFLAGS.lib${LIB}} \
1.277     christos  596:            -o ${.TARGET} ${_LIBLDOPTS} \
1.300     uebayasi  597:            -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${_LDADD.lib${LIB}}
1.196     lukem     598: #  We don't use INSTALL_SYMLINK here because this is just
                    599: #  happening inside the build directory/objdir. XXX Why does
                    600: #  this spend so much effort on libraries that aren't live??? XXX
1.284     lukem     601: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
                    602:     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.241     matt      603:        ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
1.177     mycroft   604:        mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
1.283     lukem     605: .endif
1.241     matt      606:        ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
1.177     mycroft   607:        mv -f lib${LIB}.so.tmp lib${LIB}.so
1.286     joerg     608: .if ${MKSTRIPIDENT} != "no"
                    609:        ${OBJCOPY} -R .ident ${.TARGET}
                    610: .endif
1.35      pk        611:
1.307     lukem     612: .if defined(_LIB.debug)
                    613: ${_LIB.debug}: ${_LIB.so}
                    614:        ${_MKTARGET_CREATE}
1.309     lukem     615:        (  ${OBJCOPY} --only-keep-debug ${_LIB.so} ${_LIB.debug} \
                    616:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    617:                --add-gnu-debuglink=${_LIB.debug} ${_LIB.so} \
                    618:        ) || (rm -f ${_LIB.debug}; false)
1.307     lukem     619: .endif
                    620:
1.252     lukem     621: .if !empty(LOBJS)                                                      # {
1.103     mycroft   622: LLIBS?=                -lc
1.58      cgd       623: llib-l${LIB}.ln: ${LOBJS}
1.238     lukem     624:        ${_MKTARGET_COMPILE}
1.236     lukem     625:        rm -f llib-l${LIB}.ln
1.206     thorpej   626: .if defined(DESTDIR)
1.228     lukem     627:        ${LINT} -C${LIB} ${.ALLSRC} -L${DESTDIR}/usr/libdata ${LLIBS}
1.206     thorpej   628: .else
1.228     lukem     629:        ${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.206     thorpej   630: .endif
1.252     lukem     631: .endif                                                                 # }
1.1       cgd       632:
1.280     lukem     633: lint: ${LOBJS}
                    634: .if defined(LOBJS) && !empty(LOBJS)
                    635:        ${LINT} ${LINTFLAGS} ${LOBJS}
                    636: .endif
                    637:
1.317     apb       638: # If the number of entries in CLEANFILES is too large, then the
                    639: # commands in bsd.clean.mk encounter errors like "exec(/bin/sh)
                    640: # failed (Argument list too long)".  Avoid that by splitting the
                    641: # files to clean into several lists using different variable names.
                    642: # __cleanuse is an internal target in bsd.clean.mk; the way we
                    643: # use it here mimics the way it's used by the clean target in
                    644: # bsd.clean.mk.
                    645: #
                    646: clean: libclean1 libclean2 libclean3 libclean4 libclean5
                    647: libclean1: .PHONY .MADE __cleanuse LIBCLEANFILES1
                    648: libclean2: .PHONY .MADE __cleanuse LIBCLEANFILES2
                    649: libclean3: .PHONY .MADE __cleanuse LIBCLEANFILES3
                    650: libclean4: .PHONY .MADE __cleanuse LIBCLEANFILES4
                    651: libclean5: .PHONY .MADE __cleanuse LIBCLEANFILES5
1.316     apb       652: CLEANFILES+= a.out [Ee]rrs mklog core *.core
1.317     apb       653: LIBCLEANFILES1+= lib${LIB}.a   ${STOBJS} ${STOBJS:=.tmp}
                    654: LIBCLEANFILES2+= lib${LIB}_p.a ${POBJS}  ${POBJS:=.tmp}
                    655: LIBCLEANFILES3+= lib${LIB}_g.a ${GOBJS}  ${GOBJS:=.tmp}
                    656: LIBCLEANFILES4+= lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${_LIB.debug}
                    657: LIBCLEANFILES4+= ${SOBJS} ${SOBJS:=.tmp}
                    658: LIBCLEANFILES5+= llib-l${LIB}.ln ${LOBJS}
1.252     lukem     659:
                    660: .if !target(libinstall)                                                        # {
1.148     lukem     661: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139     tv        662: libinstall::
                    663:
1.234     lukem     664: .if ${MKLINKLIB} != "no" && ${MKSTATICLIB} != "no"
1.89      christos  665: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168     mycroft   666: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.197     mycroft   667:
1.269     dbj       668: .if ${MKUPDATE} == "no"
1.197     mycroft   669: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
                    670: ${DESTDIR}${LIBDIR}/lib${LIB}.a! .MADE
1.89      christos  671: .endif
1.197     mycroft   672: ${DESTDIR}${LIBDIR}/lib${LIB}.a! lib${LIB}.a __archiveinstall
                    673: .else
1.157     fredb     674: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89      christos  675: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
                    676: .endif
                    677: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130     tv        678: .endif
1.197     mycroft   679: .endif
1.89      christos  680:
1.149     lukem     681: .if ${MKPROFILE} != "no"
1.89      christos  682: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168     mycroft   683: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.197     mycroft   684:
1.269     dbj       685: .if ${MKUPDATE} == "no"
1.197     mycroft   686: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
                    687: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! .MADE
1.32      pk        688: .endif
1.197     mycroft   689: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! lib${LIB}_p.a __archiveinstall
                    690: .else
1.157     fredb     691: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89      christos  692: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
                    693: .endif
                    694: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
                    695: .endif
1.197     mycroft   696: .endif
1.89      christos  697:
1.268     lukem     698: .if ${MKDEBUGLIB} != "no"
1.266     christos  699: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
                    700: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
                    701:
1.269     dbj       702: .if ${MKUPDATE} == "no"
1.266     christos  703: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
                    704: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! .MADE
                    705: .endif
                    706: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! lib${LIB}_g.a __archiveinstall
                    707: .else
                    708: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
                    709: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: .MADE
                    710: .endif
                    711: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: lib${LIB}_g.a __archiveinstall
                    712: .endif
                    713: .endif
                    714:
1.149     lukem     715: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168     mycroft   716: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160     simonb    717: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.197     mycroft   718:
1.269     dbj       719: .if ${MKUPDATE} == "no"
1.197     mycroft   720: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
                    721: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! .MADE
1.89      christos  722: .endif
1.197     mycroft   723: .if ${MKPICLIB} == "no"
                    724: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}.a __archivesymlinkpic
                    725: .else
                    726: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}_pic.a __archiveinstall
                    727: .endif
                    728: .else
1.157     fredb     729: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89      christos  730: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33      pk        731: .endif
1.160     simonb    732: .if ${MKPICLIB} == "no"
1.197     mycroft   733: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}.a __archivesymlinkpic
1.160     simonb    734: .else
1.89      christos  735: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160     simonb    736: .endif
1.89      christos  737: .endif
1.197     mycroft   738: .endif
1.89      christos  739:
1.171     christos  740: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
1.282     lukem     741: _LIB_SO_TGT=           ${DESTDIR}${_LIBSODIR}/${_LIB_PREFIX}${LIB}.so
                    742: _LIB_SO_TGTLIBDIR=        ${DESTDIR}${LIBDIR}/${_LIB_PREFIX}${LIB}.so
                    743:
                    744: libinstall:: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
                    745: .PRECIOUS: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
1.197     mycroft   746:
1.269     dbj       747: .if ${MKUPDATE} == "no"
1.197     mycroft   748: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
1.282     lukem     749: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! .MADE
1.89      christos  750: .endif
1.282     lukem     751: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
1.197     mycroft   752: .else
1.171     christos  753: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
1.282     lukem     754: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: .MADE
1.89      christos  755: .endif
1.282     lukem     756: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.197     mycroft   757: .endif
1.238     lukem     758:        ${_MKTARGET_INSTALL}
1.188     tv        759:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.264     jwise     760:                ${.ALLSRC} ${.TARGET}
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_FULLVERSION}
1.195     lukem     765: .endif
1.284     lukem     766: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
                    767:     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.264     jwise     768:        ${INSTALL_SYMLINK} \
1.284     lukem     769:                ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
1.282     lukem     770:                ${_LIB_SO_TGT}.${SHLIB_MAJOR}
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}.${SHLIB_MAJOR}
1.195     lukem     775: .endif
1.284     lukem     776: .endif
1.148     lukem     777: .if ${MKLINKLIB} != "no"
1.264     jwise     778:        ${INSTALL_SYMLINK} \
1.284     lukem     779:                ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
1.282     lukem     780:                ${_LIB_SO_TGT}
1.195     lukem     781: .if ${_LIBSODIR} != ${LIBDIR}
1.282     lukem     782:        ${INSTALL_SYMLINK} -l r \
                    783:                ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                    784:                ${_LIB_SO_TGTLIBDIR}
1.195     lukem     785: .endif
1.83      cgd       786: .endif
1.12      cgd       787: .endif
1.89      christos  788:
1.307     lukem     789: .if defined(_LIB.debug)
                    790: libinstall:: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}
                    791: .PRECIOUS: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}
                    792:
                    793: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}: ${_LIB.debug}
                    794:        ${_MKTARGET_INSTALL}
                    795:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    796:                ${.ALLSRC} ${.TARGET}
                    797: .endif
                    798:
1.279     lukem     799: .if ${MKLINT} != "no" && !empty(LOBJS)
1.89      christos  800: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168     mycroft   801: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.197     mycroft   802:
1.269     dbj       803: .if ${MKUPDATE} == "no"
1.197     mycroft   804: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
                    805: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! .MADE
1.89      christos  806: .endif
1.197     mycroft   807: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! llib-l${LIB}.ln
                    808: .else
1.157     fredb     809: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89      christos  810: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
                    811: .endif
1.95      mycroft   812: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.197     mycroft   813: .endif
1.238     lukem     814:        ${_MKTARGET_INSTALL}
1.188     tv        815:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.264     jwise     816:                ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58      cgd       817: .endif
1.252     lukem     818: .endif # !target(libinstall)                                           # }
1.1       cgd       819:
1.188     tv        820: ##### Pull in related .mk logic
1.298     apb       821: LINKSOWN?= ${LIBOWN}
                    822: LINKSGRP?= ${LIBGRP}
                    823: LINKSMODE?= ${LIBMODE}
1.1       cgd       824: .include <bsd.man.mk>
1.57      jtc       825: .include <bsd.nls.mk>
1.91      christos  826: .include <bsd.files.mk>
1.89      christos  827: .include <bsd.inc.mk>
1.109     cjs       828: .include <bsd.links.mk>
1.24      mycroft   829: .include <bsd.dep.mk>
1.315     joerg     830: .include <bsd.clang-analyze.mk>
1.316     apb       831: .include <bsd.clean.mk>
1.117     mycroft   832:
1.188     tv        833: ${TARGETS}:    # ensure existence

CVSweb <webmaster@jp.NetBSD.org>