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

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

CVSweb <webmaster@jp.NetBSD.org>