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

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

CVSweb <webmaster@jp.NetBSD.org>