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

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

CVSweb <webmaster@jp.NetBSD.org>