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

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

CVSweb <webmaster@jp.NetBSD.org>