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

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

CVSweb <webmaster@jp.NetBSD.org>