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

1.309   ! lukem       1: #      $NetBSD: bsd.lib.mk,v 1.308 2010/07/06 05:59:56 mrg 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.302     abs       143: # SHLIB_MAJOR, SHLIB_MINOR, SHLIB_TEENY: Major, minor, and teeny version
                    144: #                      numbers of shared library
1.164     simonb    145: # SHLIB_SOVERSION:     version number to be compiled into a shared library
                    146: #                      via -soname. Usualy ${SHLIB_MAJOR} on ELF.
1.173     christos  147: #                      NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
                    148: #                      [.${SHLIB_TEENY}]]
1.164     simonb    149: # SHLIB_SHFLAGS:       Flags to tell ${LD} to emit shared library.
1.123     jonathan  150: #                      with ELF, also set shared-lib version for ld.so.
                    151: # SHLIB_LDSTARTFILE:   support .o file, call C++ file-level constructors
                    152: # SHLIB_LDENDFILE:     support .o file, call C++ file-level destructors
1.304     njoly     153: # FPICFLAGS:           flags for ${FC} to compile .[fF] files to .pico objects.
1.271     tsutsui   154: # CPPPICFLAGS:         flags for ${CPP} to preprocess .[sS] files for ${AS}
1.205     yamt      155: # CPICFLAGS:           flags for ${CC} to compile .[cC] files to pic objects.
1.304     njoly     156: # CSHLIBFLAGS:         flags for ${CC} to compile .[cC] files to .pico objects.
1.205     yamt      157: #                      (usually includes ${CPICFLAGS})
                    158: # CAPICFLAGS:          flags for ${CC} to compiling .[Ss] files
1.107     jonathan  159: #                      (usually just ${CPPPICFLAGS} ${CPICFLAGS})
1.304     njoly     160: # APICFLAGS:           flags for ${AS} to assemble .[sS] to .pico objects.
1.86      jonathan  161:
1.252     lukem     162: .if ${MACHINE_ARCH} == "alpha"                                         # {
1.209     thorpej   163:
1.179     dmcmahil  164: FPICFLAGS ?= -fPIC
1.165     dmcmahil  165: CPICFLAGS ?= -fPIC -DPIC
1.222     lukem     166: CPPPICFLAGS?= -DPIC
1.107     jonathan  167: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    168: APICFLAGS ?=
1.209     thorpej   169:
1.308     mrg       170: .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")     # } {
1.209     thorpej   171:
1.222     lukem     172: # If you use -fPIC you need to define BIGPIC to turn on 32-bit
1.202     eeh       173: # relocations in asm code
1.179     dmcmahil  174: FPICFLAGS ?= -fPIC
1.165     dmcmahil  175: CPICFLAGS ?= -fPIC -DPIC
1.202     eeh       176: CPPPICFLAGS?= -DPIC -DBIGPIC
1.150     christos  177: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
1.203     eeh       178: APICFLAGS ?= -KPIC
1.204     fredette  179:
1.252     lukem     180: .else                                                                  # } {
1.86      jonathan  181:
1.244     skrll     182: # Platform-independent flags for NetBSD shared libraries
1.171     christos  183: SHLIB_SOVERSION=${SHLIB_FULLVERSION}
1.125     jonathan  184: SHLIB_SHFLAGS=
1.179     dmcmahil  185: FPICFLAGS ?= -fPIC
1.165     dmcmahil  186: CPICFLAGS?= -fPIC -DPIC
1.222     lukem     187: CPPPICFLAGS?= -DPIC
1.107     jonathan  188: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    189: APICFLAGS?= -k
1.86      jonathan  190:
1.252     lukem     191: .endif                                                                 # }
1.160     simonb    192:
1.205     yamt      193: .if ${MKPICLIB} != "no"
                    194: CSHLIBFLAGS+= ${CPICFLAGS}
                    195: .endif
                    196:
                    197: .if defined(CSHLIBFLAGS) && !empty(CSHLIBFLAGS)
                    198: MKSHLIBOBJS= yes
                    199: .else
                    200: MKSHLIBOBJS= no
                    201: .endif
                    202:
1.123     jonathan  203: # Platform-independent linker flags for ELF shared libraries
1.182     mrg       204: SHLIB_SOVERSION=       ${SHLIB_MAJOR}
1.282     lukem     205: SHLIB_SHFLAGS=         -Wl,-soname,${_LIB_PREFIX}${LIB}.so.${SHLIB_SOVERSION}
1.272     christos  206: SHLIB_SHFLAGS+=                -Wl,--warn-shared-textrel
1.301     mrg       207: SHLIB_LDSTARTFILE?=    ${_GCC_CRTDIR}/crti.o ${_GCC_CRTBEGINS}
                    208: SHLIB_LDENDFILE?=      ${_GCC_CRTENDS} ${_GCC_CRTDIR}/crtn.o
1.86      jonathan  209:
1.82      mikel     210: CFLAGS+=       ${COPTS}
1.267     mrg       211: OBJCFLAGS+=    ${OBJCOPTS}
1.257     simonb    212: AFLAGS+=       ${COPTS}
1.179     dmcmahil  213: FFLAGS+=       ${FOPTS}
1.1       cgd       214:
1.305     darran    215: .if defined(CTFCONVERT)
                    216: .if defined(CFLAGS) && !empty(CFLAGS:M*-g*)
                    217: CTFFLAGS+=     -g
                    218: .endif
                    219: .endif
                    220:
1.1       cgd       221: .c.o:
1.238     lukem     222:        ${_MKTARGET_COMPILE}
1.263     dsl       223:        ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    224: .if defined(CTFCONVERT)
                    225:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    226: .endif
1.270     martin    227: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.263     dsl       228:        ${OBJCOPY} -x ${.TARGET}
1.153     christos  229: .endif
1.1       cgd       230:
                    231: .c.po:
1.238     lukem     232:        ${_MKTARGET_COMPILE}
1.263     dsl       233:        ${COMPILE.c} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
1.305     darran    234: .if defined(CTFCONVERT)
                    235:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    236: .endif
1.270     martin    237: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.263     dsl       238:        ${OBJCOPY} -X ${.TARGET}
1.153     christos  239: .endif
1.17      mycroft   240:
1.266     christos  241: .c.go:
                    242:        ${_MKTARGET_COMPILE}
                    243:        ${COMPILE.c} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
                    244:
1.304     njoly     245: .c.pico:
1.238     lukem     246:        ${_MKTARGET_COMPILE}
1.263     dsl       247:        ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
1.270     martin    248: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.263     dsl       249:        ${OBJCOPY} -x ${.TARGET}
1.153     christos  250: .endif
1.27      pk        251:
1.223     lukem     252: .cc.o .cpp.o .cxx.o .C.o:
1.238     lukem     253:        ${_MKTARGET_COMPILE}
1.263     dsl       254:        ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.270     martin    255: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.263     dsl       256:        ${OBJCOPY} -x ${.TARGET}
1.153     christos  257: .endif
1.17      mycroft   258:
1.266     christos  259: .cc.po .cpp.po .cxx.po .C.po:
1.238     lukem     260:        ${_MKTARGET_COMPILE}
1.263     dsl       261:        ${COMPILE.cc} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
1.270     martin    262: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.263     dsl       263:        ${OBJCOPY} -X ${.TARGET}
1.153     christos  264: .endif
1.28      cgd       265:
1.266     christos  266: .cc.go .cpp.go .cxx.go .C.go:
                    267:        ${_MKTARGET_COMPILE}
                    268:        ${COMPILE.cc} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
                    269:
1.304     njoly     270: .cc.pico .cpp.pico .cxx.pico .C.pico:
1.238     lukem     271:        ${_MKTARGET_COMPILE}
1.263     dsl       272:        ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
1.270     martin    273: .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
1.263     dsl       274:        ${OBJCOPY} -x ${.TARGET}
1.153     christos  275: .endif
1.118     lukem     276:
1.179     dmcmahil  277: .f.o:
1.238     lukem     278:        ${_MKTARGET_COMPILE}
1.263     dsl       279:        ${COMPILE.f} ${.IMPSRC} -o ${.TARGET}
1.305     darran    280: .if defined(CTFCONVERT)
                    281:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    282: .endif
1.263     dsl       283: .if !defined(FOPTS) || empty(FOPTS:M*-g*)
                    284:        ${OBJCOPY} -x ${.TARGET}
1.179     dmcmahil  285: .endif
                    286:
                    287: .f.po:
1.238     lukem     288:        ${_MKTARGET_COMPILE}
1.263     dsl       289:        ${COMPILE.f} ${PROFFLAGS} -pg ${.IMPSRC} -o ${.TARGET}
1.305     darran    290: .if defined(CTFCONVERT)
                    291:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    292: .endif
1.263     dsl       293: .if !defined(FOPTS) || empty(FOPTS:M*-g*)
                    294:        ${OBJCOPY} -X ${.TARGET}
1.179     dmcmahil  295: .endif
                    296:
1.266     christos  297: .f.go:
                    298:        ${_MKTARGET_COMPILE}
                    299:        ${COMPILE.f} ${DEBUGFLAGS} -g ${.IMPSRC} -o ${.TARGET}
                    300:
1.304     njoly     301: .f.pico:
1.238     lukem     302:        ${_MKTARGET_COMPILE}
1.263     dsl       303:        ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    304: .if !defined(FOPTS) || empty(FOPTS:M*-g*)
                    305:        ${OBJCOPY} -x ${.TARGET}
1.179     dmcmahil  306: .endif
                    307:
                    308: .f.ln:
1.238     lukem     309:        ${_MKTARGET_COMPILE}
1.217     wiz       310:        @echo Skipping lint for Fortran libraries.
1.179     dmcmahil  311:
1.118     lukem     312: .m.o:
1.238     lukem     313:        ${_MKTARGET_COMPILE}
1.267     mrg       314:        ${COMPILE.m} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    315: .if defined(CTFCONVERT)
                    316:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    317: .endif
1.263     dsl       318: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
                    319:        ${OBJCOPY} -x ${.TARGET}
1.153     christos  320: .endif
1.118     lukem     321:
                    322: .m.po:
1.238     lukem     323:        ${_MKTARGET_COMPILE}
1.267     mrg       324:        ${COMPILE.m} ${PROFFLAGS} -pg ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    325: .if defined(CTFCONVERT)
                    326:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    327: .endif
1.263     dsl       328: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
                    329:        ${OBJCOPY} -X ${.TARGET}
1.153     christos  330: .endif
1.118     lukem     331:
1.266     christos  332: .m.go:
                    333:        ${_MKTARGET_COMPILE}
1.267     mrg       334:        ${COMPILE.m} ${DEBUGFLAGS} -g ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.266     christos  335: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
                    336:        ${OBJCOPY} -X ${.TARGET}
                    337: .endif
                    338:
1.304     njoly     339: .m.pico:
1.238     lukem     340:        ${_MKTARGET_COMPILE}
1.267     mrg       341:        ${COMPILE.m} ${CSHLIBFLAGS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.263     dsl       342: .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
                    343:        ${OBJCOPY} -x ${.TARGET}
1.153     christos  344: .endif
1.1       cgd       345:
1.251     lukem     346: .s.o:
1.238     lukem     347:        ${_MKTARGET_COMPILE}
1.263     dsl       348:        ${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    349: .if defined(CTFCONVERT)
                    350:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    351: .endif
1.263     dsl       352:        ${OBJCOPY} -x ${.TARGET}
1.1       cgd       353:
1.251     lukem     354: .S.o:
                    355:        ${_MKTARGET_COMPILE}
1.263     dsl       356:        ${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    357: .if defined(CTFCONVERT)
                    358:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    359: .endif
1.263     dsl       360:        ${OBJCOPY} -x ${.TARGET}
1.251     lukem     361:
                    362: .s.po:
                    363:        ${_MKTARGET_COMPILE}
1.263     dsl       364:        ${COMPILE.s} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    365: .if defined(CTFCONVERT)
                    366:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    367: .endif
1.263     dsl       368:        ${OBJCOPY} -X ${.TARGET}
1.251     lukem     369:
                    370: .S.po:
1.238     lukem     371:        ${_MKTARGET_COMPILE}
1.263     dsl       372:        ${COMPILE.S} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
1.305     darran    373: .if defined(CTFCONVERT)
                    374:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                    375: .endif
1.263     dsl       376:        ${OBJCOPY} -X ${.TARGET}
1.1       cgd       377:
1.266     christos  378: .s.go:
                    379:        ${_MKTARGET_COMPILE}
                    380:        ${COMPILE.s} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
                    381:
                    382: .S.go:
                    383:        ${_MKTARGET_COMPILE}
                    384:        ${COMPILE.S} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
                    385:
1.304     njoly     386: .s.pico:
1.251     lukem     387:        ${_MKTARGET_COMPILE}
1.263     dsl       388:        ${COMPILE.s} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
                    389:        ${OBJCOPY} -x ${.TARGET}
1.251     lukem     390:
1.304     njoly     391: .S.pico:
1.238     lukem     392:        ${_MKTARGET_COMPILE}
1.263     dsl       393:        ${COMPILE.S} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
                    394:        ${OBJCOPY} -x ${.TARGET}
1.27      pk        395:
1.252     lukem     396: .if defined(LIB)                                                       # {
1.234     lukem     397: .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    398:        || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
1.130     tv        399: _LIBS=lib${LIB}.a
                    400: .else
                    401: _LIBS=
                    402: .endif
1.58      cgd       403:
1.167     matt      404: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.158     christos  405:
1.255     thorpej   406: STOBJS+=${OBJS}
                    407:
1.280     lukem     408: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
                    409:
1.281     lukem     410: .if ${LIBISPRIVATE} != "no"
1.252     lukem     411: # No installation is required
                    412: libinstall::
1.306     lukem     413: .endif
1.252     lukem     414:
1.268     lukem     415: .if ${MKDEBUGLIB} != "no"
1.266     christos  416: _LIBS+=lib${LIB}_g.a
                    417: GOBJS+=${OBJS:.o=.go}
                    418: DEBUGFLAGS?=-DDEBUG
                    419: .endif
                    420:
1.149     lukem     421: .if ${MKPROFILE} != "no"
1.130     tv        422: _LIBS+=lib${LIB}_p.a
1.167     matt      423: POBJS+=${OBJS:.o=.po}
1.262     christos  424: PROFFLAGS?=-DGPROF -DPROF
1.1       cgd       425: .endif
                    426:
1.252     lukem     427: .if ${MKPIC} != "no"                                                   # {
1.160     simonb    428: .if ${MKPICLIB} == "no"
1.205     yamt      429: .if ${MKSHLIBOBJS} != "no"
                    430: # make _pic.a, which isn't really pic,
                    431: # since it's needed for making shared lib.
                    432: # but don't install it.
                    433: SOLIB=lib${LIB}_pic.a
1.304     njoly     434: SOBJS+=${OBJS:.o=.pico}
1.205     yamt      435: .else
1.160     simonb    436: SOLIB=lib${LIB}.a
1.205     yamt      437: .endif
1.160     simonb    438: .else
                    439: SOLIB=lib${LIB}_pic.a
                    440: _LIBS+=${SOLIB}
1.304     njoly     441: SOBJS+=${OBJS:.o=.pico}
1.160     simonb    442: .endif
1.171     christos  443: .if defined(SHLIB_FULLVERSION)
1.307     lukem     444: _LIB.so:=lib${LIB}.so.${SHLIB_FULLVERSION}
1.308     mrg       445: .if ${MKDEBUG} != "no"
1.307     lukem     446: _LIB.debug:=${_LIB.so}.debug
                    447: .endif
1.171     christos  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.307     lukem     474: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} ${_LIB.debug}
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.196     lukem     575: #  We don't use INSTALL_SYMLINK here because this is just
                    576: #  happening inside the build directory/objdir. XXX Why does
                    577: #  this spend so much effort on libraries that aren't live??? XXX
1.284     lukem     578: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
                    579:     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.241     matt      580:        ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
1.177     mycroft   581:        mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
1.283     lukem     582: .endif
1.241     matt      583:        ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
1.177     mycroft   584:        mv -f lib${LIB}.so.tmp lib${LIB}.so
1.286     joerg     585: .if ${MKSTRIPIDENT} != "no"
                    586:        ${OBJCOPY} -R .ident ${.TARGET}
                    587: .endif
1.35      pk        588:
1.307     lukem     589: .if defined(_LIB.debug)
                    590: ${_LIB.debug}: ${_LIB.so}
                    591:        ${_MKTARGET_CREATE}
1.309   ! lukem     592:        (  ${OBJCOPY} --only-keep-debug ${_LIB.so} ${_LIB.debug} \
        !           593:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
        !           594:                --add-gnu-debuglink=${_LIB.debug} ${_LIB.so} \
        !           595:        ) || (rm -f ${_LIB.debug}; false)
1.307     lukem     596: .endif
                    597:
1.252     lukem     598: .if !empty(LOBJS)                                                      # {
1.103     mycroft   599: LLIBS?=                -lc
1.58      cgd       600: llib-l${LIB}.ln: ${LOBJS}
1.238     lukem     601:        ${_MKTARGET_COMPILE}
1.236     lukem     602:        rm -f llib-l${LIB}.ln
1.206     thorpej   603: .if defined(DESTDIR)
1.228     lukem     604:        ${LINT} -C${LIB} ${.ALLSRC} -L${DESTDIR}/usr/libdata ${LLIBS}
1.206     thorpej   605: .else
1.228     lukem     606:        ${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.206     thorpej   607: .endif
1.252     lukem     608: .endif                                                                 # }
1.1       cgd       609:
1.280     lukem     610: lint: ${LOBJS}
                    611: .if defined(LOBJS) && !empty(LOBJS)
                    612:        ${LINT} ${LINTFLAGS} ${LOBJS}
                    613: .endif
                    614:
1.246     lukem     615: cleanlib: .PHONY
1.48      mycroft   616:        rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
1.255     thorpej   617:        rm -f lib${LIB}.a ${STOBJS}
1.59      cgd       618:        rm -f lib${LIB}_p.a ${POBJS}
1.266     christos  619:        rm -f lib${LIB}_g.a ${GOBJS}
1.307     lukem     620:        rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${_LIB.debug} ${SOBJS}
1.266     christos  621:        rm -f ${STOBJS:=.tmp} ${POBJS:=.tmp} ${SOBJS:=.tmp} ${GOBJS:=.tmp}
1.59      cgd       622:        rm -f llib-l${LIB}.ln ${LOBJS}
1.1       cgd       623:
1.252     lukem     624:
                    625: .if !target(libinstall)                                                        # {
1.148     lukem     626: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139     tv        627: libinstall::
                    628:
1.234     lukem     629: .if ${MKLINKLIB} != "no" && ${MKSTATICLIB} != "no"
1.89      christos  630: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168     mycroft   631: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.197     mycroft   632:
1.269     dbj       633: .if ${MKUPDATE} == "no"
1.197     mycroft   634: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
                    635: ${DESTDIR}${LIBDIR}/lib${LIB}.a! .MADE
1.89      christos  636: .endif
1.197     mycroft   637: ${DESTDIR}${LIBDIR}/lib${LIB}.a! lib${LIB}.a __archiveinstall
                    638: .else
1.157     fredb     639: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89      christos  640: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
                    641: .endif
                    642: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130     tv        643: .endif
1.197     mycroft   644: .endif
1.89      christos  645:
1.149     lukem     646: .if ${MKPROFILE} != "no"
1.89      christos  647: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168     mycroft   648: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.197     mycroft   649:
1.269     dbj       650: .if ${MKUPDATE} == "no"
1.197     mycroft   651: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
                    652: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! .MADE
1.32      pk        653: .endif
1.197     mycroft   654: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! lib${LIB}_p.a __archiveinstall
                    655: .else
1.157     fredb     656: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89      christos  657: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
                    658: .endif
                    659: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
                    660: .endif
1.197     mycroft   661: .endif
1.89      christos  662:
1.268     lukem     663: .if ${MKDEBUGLIB} != "no"
1.266     christos  664: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
                    665: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
                    666:
1.269     dbj       667: .if ${MKUPDATE} == "no"
1.266     christos  668: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
                    669: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! .MADE
                    670: .endif
                    671: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! lib${LIB}_g.a __archiveinstall
                    672: .else
                    673: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
                    674: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: .MADE
                    675: .endif
                    676: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: lib${LIB}_g.a __archiveinstall
                    677: .endif
                    678: .endif
                    679:
1.149     lukem     680: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168     mycroft   681: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160     simonb    682: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.197     mycroft   683:
1.269     dbj       684: .if ${MKUPDATE} == "no"
1.197     mycroft   685: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
                    686: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! .MADE
1.89      christos  687: .endif
1.197     mycroft   688: .if ${MKPICLIB} == "no"
                    689: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}.a __archivesymlinkpic
                    690: .else
                    691: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}_pic.a __archiveinstall
                    692: .endif
                    693: .else
1.157     fredb     694: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89      christos  695: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33      pk        696: .endif
1.160     simonb    697: .if ${MKPICLIB} == "no"
1.197     mycroft   698: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}.a __archivesymlinkpic
1.160     simonb    699: .else
1.89      christos  700: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160     simonb    701: .endif
1.89      christos  702: .endif
1.197     mycroft   703: .endif
1.89      christos  704:
1.171     christos  705: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
1.282     lukem     706: _LIB_SO_TGT=           ${DESTDIR}${_LIBSODIR}/${_LIB_PREFIX}${LIB}.so
                    707: _LIB_SO_TGTLIBDIR=        ${DESTDIR}${LIBDIR}/${_LIB_PREFIX}${LIB}.so
                    708:
                    709: libinstall:: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
                    710: .PRECIOUS: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
1.197     mycroft   711:
1.269     dbj       712: .if ${MKUPDATE} == "no"
1.197     mycroft   713: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
1.282     lukem     714: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! .MADE
1.89      christos  715: .endif
1.282     lukem     716: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
1.197     mycroft   717: .else
1.171     christos  718: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
1.282     lukem     719: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: .MADE
1.89      christos  720: .endif
1.282     lukem     721: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.197     mycroft   722: .endif
1.238     lukem     723:        ${_MKTARGET_INSTALL}
1.188     tv        724:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.264     jwise     725:                ${.ALLSRC} ${.TARGET}
1.195     lukem     726: .if ${_LIBSODIR} != ${LIBDIR}
1.282     lukem     727:        ${INSTALL_SYMLINK} -l r \
                    728:                ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                    729:                ${_LIB_SO_TGTLIBDIR}.${SHLIB_FULLVERSION}
1.195     lukem     730: .endif
1.284     lukem     731: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
                    732:     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.264     jwise     733:        ${INSTALL_SYMLINK} \
1.284     lukem     734:                ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
1.282     lukem     735:                ${_LIB_SO_TGT}.${SHLIB_MAJOR}
1.195     lukem     736: .if ${_LIBSODIR} != ${LIBDIR}
1.282     lukem     737:        ${INSTALL_SYMLINK} -l r \
                    738:                ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                    739:                ${_LIB_SO_TGTLIBDIR}.${SHLIB_MAJOR}
1.195     lukem     740: .endif
1.284     lukem     741: .endif
1.148     lukem     742: .if ${MKLINKLIB} != "no"
1.264     jwise     743:        ${INSTALL_SYMLINK} \
1.284     lukem     744:                ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
1.282     lukem     745:                ${_LIB_SO_TGT}
1.195     lukem     746: .if ${_LIBSODIR} != ${LIBDIR}
1.282     lukem     747:        ${INSTALL_SYMLINK} -l r \
                    748:                ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                    749:                ${_LIB_SO_TGTLIBDIR}
1.195     lukem     750: .endif
1.83      cgd       751: .endif
1.12      cgd       752: .endif
1.89      christos  753:
1.307     lukem     754: .if defined(_LIB.debug)
                    755: libinstall:: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}
                    756: .PRECIOUS: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}
                    757:
                    758: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}: ${_LIB.debug}
                    759:        ${_MKTARGET_INSTALL}
                    760:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    761:                ${.ALLSRC} ${.TARGET}
                    762: .endif
                    763:
1.279     lukem     764: .if ${MKLINT} != "no" && !empty(LOBJS)
1.89      christos  765: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168     mycroft   766: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.197     mycroft   767:
1.269     dbj       768: .if ${MKUPDATE} == "no"
1.197     mycroft   769: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
                    770: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! .MADE
1.89      christos  771: .endif
1.197     mycroft   772: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! llib-l${LIB}.ln
                    773: .else
1.157     fredb     774: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89      christos  775: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
                    776: .endif
1.95      mycroft   777: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.197     mycroft   778: .endif
1.238     lukem     779:        ${_MKTARGET_INSTALL}
1.188     tv        780:        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.264     jwise     781:                ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58      cgd       782: .endif
1.252     lukem     783: .endif # !target(libinstall)                                           # }
1.1       cgd       784:
1.188     tv        785: ##### Pull in related .mk logic
1.298     apb       786: LINKSOWN?= ${LIBOWN}
                    787: LINKSGRP?= ${LIBGRP}
                    788: LINKSMODE?= ${LIBMODE}
1.1       cgd       789: .include <bsd.man.mk>
1.57      jtc       790: .include <bsd.nls.mk>
1.91      christos  791: .include <bsd.files.mk>
1.89      christos  792: .include <bsd.inc.mk>
1.109     cjs       793: .include <bsd.links.mk>
1.24      mycroft   794: .include <bsd.dep.mk>
1.117     mycroft   795:
1.188     tv        796: ${TARGETS}:    # ensure existence

CVSweb <webmaster@jp.NetBSD.org>