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

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

CVSweb <webmaster@jp.NetBSD.org>