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

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

CVSweb <webmaster@jp.NetBSD.org>