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

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

CVSweb <webmaster@jp.NetBSD.org>