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

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

CVSweb <webmaster@jp.NetBSD.org>