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

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

CVSweb <webmaster@jp.NetBSD.org>