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

1.169.2.6! skrll       1: #      $NetBSD: bsd.lib.mk,v 1.169.2.5 2000/08/22 06:27:13 mrg Exp $
1.92      mikel       2: #      @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
1.1       cgd         3:
1.117     mycroft     4: .if !target(__initialized__)
                      5: __initialized__:
1.1       cgd         6: .if exists(${.CURDIR}/../Makefile.inc)
                      7: .include "${.CURDIR}/../Makefile.inc"
                      8: .endif
1.97      mycroft     9: .include <bsd.own.mk>
1.117     mycroft    10: .include <bsd.obj.mk>
1.159     perry      11: .include <bsd.depall.mk>
1.117     mycroft    12: .MAIN:         all
                     13: .endif
1.97      mycroft    14:
1.143     erh        15: .PHONY:                checkver cleanlib libinstall
                     16: realinstall:   checkver libinstall
1.137     lukem      17: clean cleandir distclean: cleanlib
1.1       cgd        18:
1.154     simonb     19: .if exists(${SHLIB_VERSION_FILE})
                     20: SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
                     21: SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
1.169.2.4  kleink     22: SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
1.143     erh        23:
                     24: # Check for higher installed library versions.
1.145     erh        25: .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
                     26:        exists(${BSDSRCDIR}/lib/checkver)
1.143     erh        27: checkver:
1.144     erh        28:        @(cd ${.CURDIR} && \
1.169.2.3  gmcgarry   29:                sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
1.154     simonb     30:                    -d ${DESTDIR}${LIBDIR} ${LIB})
1.169.2.6! skrll      31: .endif
        !            32: .endif
        !            33:
        !            34: .if !target(checkver)
1.143     erh        35: checkver:
                     36: .endif
1.169.2.6! skrll      37:
1.169     thorpej    38: print-shlib-major:
1.169.2.6! skrll      39: .if defined(SHLIB_MAJOR)
1.169     thorpej    40:        @echo ${SHLIB_MAJOR}
1.169.2.6! skrll      41: .else
        !            42:        @false
        !            43: .endif
1.169     thorpej    44:
                     45: print-shlib-minor:
1.169.2.6! skrll      46: .if defined(SHLIB_MINOR)
1.169     thorpej    47:        @echo ${SHLIB_MINOR}
1.169.2.6! skrll      48: .else
        !            49:        @false
        !            50: .endif
1.169.2.4  kleink     51:
                     52: print-shlib-teeny:
1.169.2.6! skrll      53: .if defined(SHLIB_TEENY)
1.169.2.4  kleink     54:        @echo ${SHLIB_TEENY}
1.143     erh        55: .else
1.169     thorpej    56:        @false
1.169.2.6! skrll      57: .endif
1.169.2.4  kleink     58:
1.169.2.6! skrll      59: .if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
        !            60: .if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
        !            61: .if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
        !            62: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
        !            63: .else
        !            64: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
        !            65: .endif
        !            66: .else
        !            67: SHLIB_FULLVERSION=${SHLIB_MAJOR}
        !            68: .endif
1.35      pk         69: .endif
1.1       cgd        70:
1.101     mycroft    71: # add additional suffixes not exported.
                     72: # .po is used for profiling object files.
                     73: # .so is used for PIC object files.
1.118     lukem      74: .SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
                     75: .SUFFIXES: .sh .m4 .m
1.82      mikel      76:
1.86      jonathan   77:
                     78: # Set PICFLAGS to cc flags for producing position-independent code,
                     79: # if not already set.  Includes -DPIC, if required.
                     80:
1.164     simonb     81: # Data-driven table using make variables to control how shared libraries
1.86      jonathan   82: # are built for different platforms and object formats.
1.125     jonathan   83: # OBJECT_FMT:          currently either "ELF" or "a.out", from <bsd.own.mk>
1.164     simonb     84: # SHLIB_SOVERSION:     version number to be compiled into a shared library
                     85: #                      via -soname. Usualy ${SHLIB_MAJOR} on ELF.
1.169.2.6! skrll      86: #                      NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
        !            87: #                      [.${SHLIB_TEENY}]]
1.164     simonb     88: # SHLIB_SHFLAGS:       Flags to tell ${LD} to emit shared library.
1.123     jonathan   89: #                      with ELF, also set shared-lib version for ld.so.
                     90: # SHLIB_LDSTARTFILE:   support .o file, call C++ file-level constructors
                     91: # SHLIB_LDENDFILE:     support .o file, call C++ file-level destructors
1.164     simonb     92: # CPPICFLAGS:          flags for ${CPP} to preprocess .[sS] files for ${AS}
                     93: # CPICFLAGS:           flags for ${CC} to compile .[cC] files to .so objects.
                     94: # CAPICFLAGS           flags for {$CC} to compiling .[Ss] files
1.107     jonathan   95: #                      (usually just ${CPPPICFLAGS} ${CPICFLAGS})
1.164     simonb     96: # APICFLAGS:           flags for ${AS} to assemble .[sS] to .so objects.
1.86      jonathan   97:
1.148     lukem      98: .if ${MACHINE_ARCH} == "alpha"
1.123     jonathan   99:                # Alpha-specific shared library flags
1.165     dmcmahil  100: CPICFLAGS ?= -fPIC -DPIC
1.107     jonathan  101: CPPPICFLAGS?= -DPIC
                    102: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    103: APICFLAGS ?=
1.151     drochner  104: .elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
1.123     jonathan  105:                # mips-specific shared library flags
1.86      jonathan  106:
1.160     simonb    107: # On mips, all libs are compiled with ABIcalls, not just sharedlibs.
                    108: MKPICLIB= no
                    109:
                    110: # so turn shlib PIC flags on for ${AS}.
                    111: AINC+=-DABICALLS
1.86      jonathan  112: AFLAGS+= -fPIC
                    113: AS+=   -KPIC
1.150     christos  114:
1.169.2.5  mrg       115: .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
                    116:        ${OBJECT_FMT} == "ELF"
1.169.2.2  mycroft   117:
                    118: CPICFLAGS ?= -fPIC -DPIC
                    119: CPPPICFLAGS?= -DPIC
                    120: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    121: APICFLAGS ?= -KPIC
                    122:
                    123: .elif ${MACHINE_ARCH} == "sparc64" && ${OBJECT_FMT} == "ELF"
1.150     christos  124:
1.165     dmcmahil  125: CPICFLAGS ?= -fPIC -DPIC
1.150     christos  126: CPPPICFLAGS?= -DPIC
                    127: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    128: APICFLAGS ?= -KPIC
1.86      jonathan  129:
                    130: .else
                    131:
1.125     jonathan  132: # Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
1.88      cgd       133: SHLIB_LDSTARTFILE=
                    134: SHLIB_LDENDFILE=
1.169.2.4  kleink    135: SHLIB_SOVERSION=${SHLIB_FULLVERSION}
1.125     jonathan  136: SHLIB_SHFLAGS=
1.165     dmcmahil  137: CPICFLAGS?= -fPIC -DPIC
1.107     jonathan  138: CPPPICFLAGS?= -DPIC
                    139: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    140: APICFLAGS?= -k
1.86      jonathan  141:
                    142: .endif
                    143:
1.160     simonb    144: MKPICLIB?= yes
                    145:
1.123     jonathan  146: # Platform-independent linker flags for ELF shared libraries
1.148     lukem     147: .if ${OBJECT_FMT} == "ELF"
1.123     jonathan  148: SHLIB_SOVERSION=${SHLIB_MAJOR}
1.125     jonathan  149: SHLIB_SHFLAGS=-soname lib${LIB}.so.${SHLIB_SOVERSION}
1.142     jonathan  150: SHLIB_LDSTARTFILE= ${DESTDIR}/usr/lib/crtbeginS.o
                    151: SHLIB_LDENDFILE= ${DESTDIR}/usr/lib/crtendS.o
1.123     jonathan  152: .endif
1.86      jonathan  153:
1.82      mikel     154: CFLAGS+=       ${COPTS}
1.1       cgd       155:
                    156: .c.o:
1.153     christos  157: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    158:        ${COMPILE.c} ${.IMPSRC}
                    159: .else
1.80      christos  160:        @echo ${COMPILE.c:Q} ${.IMPSRC}
1.122     cgd       161:        @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  162:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    163:        @rm -f ${.TARGET}.o
1.153     christos  164: .endif
1.1       cgd       165:
                    166: .c.po:
1.153     christos  167: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    168:        ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
                    169: .else
1.80      christos  170:        @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68      cgd       171:        @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  172:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    173:        @rm -f ${.TARGET}.o
1.153     christos  174: .endif
1.17      mycroft   175:
1.27      pk        176: .c.so:
1.153     christos  177: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    178:        ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    179: .else
1.86      jonathan  180:        @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    181:        @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  182:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    183:        @rm -f ${.TARGET}.o
1.153     christos  184: .endif
1.27      pk        185:
1.58      cgd       186: .c.ln:
1.121     thorpej   187:        ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
1.58      cgd       188:
1.18      mycroft   189: .cc.o .C.o:
1.153     christos  190: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    191:        ${COMPILE.cc} ${.IMPSRC}
                    192: .else
1.80      christos  193:        @echo ${COMPILE.cc:Q} ${.IMPSRC}
1.62      christos  194:        @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
1.63      jtc       195:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1.62      christos  196:        @rm -f ${.TARGET}.o
1.153     christos  197: .endif
1.17      mycroft   198:
1.18      mycroft   199: .cc.po .C.po:
1.153     christos  200: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    201:        ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
                    202: .else
1.80      christos  203:        @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68      cgd       204:        @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  205:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    206:        @rm -f ${.TARGET}.o
1.153     christos  207: .endif
1.28      cgd       208:
                    209: .cc.so .C.so:
1.153     christos  210: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    211:        ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    212: .else
1.86      jonathan  213:        @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    214:        @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  215:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    216:        @rm -f ${.TARGET}.o
1.153     christos  217: .endif
1.118     lukem     218:
                    219: .m.o:
1.153     christos  220: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    221:        ${COMPILE.m} ${.IMPSRC}
                    222: .else
1.118     lukem     223:        @echo ${COMPILE.m:Q} ${.IMPSRC}
1.122     cgd       224:        @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
1.118     lukem     225:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    226:        @rm -f ${.TARGET}.o
1.153     christos  227: .endif
1.118     lukem     228:
                    229: .m.po:
1.153     christos  230: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    231:        ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
                    232: .else
1.118     lukem     233:        @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
                    234:        @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
                    235:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    236:        @rm -f ${.TARGET}.o
1.153     christos  237: .endif
1.118     lukem     238:
                    239: .m.so:
1.153     christos  240: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    241:        ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    242: .else
1.118     lukem     243:        @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    244:        @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
                    245:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    246:        @rm -f ${.TARGET}.o
1.153     christos  247: .endif
1.1       cgd       248:
1.40      cgd       249: .S.o .s.o:
1.80      christos  250:        @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
1.69      jtc       251:        @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  252:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    253:        @rm -f ${.TARGET}.o
1.1       cgd       254:
1.40      cgd       255: .S.po .s.po:
1.80      christos  256:        @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
1.75      jtc       257:        @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  258:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    259:        @rm -f ${.TARGET}.o
1.1       cgd       260:
1.40      cgd       261: .S.so .s.so:
1.107     jonathan  262:        @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
                    263:        @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  264:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    265:        @rm -f ${.TARGET}.o
1.27      pk        266:
1.148     lukem     267: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    268:        || ${MKLINKLIB} != "no"
1.130     tv        269: _LIBS=lib${LIB}.a
                    270: .else
                    271: _LIBS=
                    272: .endif
1.58      cgd       273:
1.167     matt      274: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.158     christos  275:
1.149     lukem     276: .if ${MKPROFILE} != "no"
1.130     tv        277: _LIBS+=lib${LIB}_p.a
1.167     matt      278: POBJS+=${OBJS:.o=.po}
1.1       cgd       279: .endif
                    280:
1.148     lukem     281: .if ${MKPIC} != "no"
1.160     simonb    282: .if ${MKPICLIB} == "no"
                    283: SOLIB=lib${LIB}.a
                    284: .else
                    285: SOLIB=lib${LIB}_pic.a
                    286: _LIBS+=${SOLIB}
1.167     matt      287: SOBJS+=${OBJS:.o=.so}
1.160     simonb    288: .endif
1.169.2.4  kleink    289: .if defined(SHLIB_FULLVERSION)
                    290: _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
1.27      pk        291: .endif
1.35      pk        292: .endif
1.27      pk        293:
1.148     lukem     294: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"
1.58      cgd       295: _LIBS+=llib-l${LIB}.ln
1.158     christos  296: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.27      pk        297: .endif
                    298:
1.167     matt      299: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    300:        || ${MKLINKLIB} != "no"
1.158     christos  301: ALLOBJS=${OBJS} ${POBJS} ${SOBJS} ${LOBJS}
1.167     matt      302: .else
                    303: ALLOBJS=${POBJS} ${SOBJS} ${LOBJS}
                    304: .endif
1.163     erh       305: .NOPATH: ${ALLOBJS} ${_LIBS}
1.158     christos  306:
1.162     mycroft   307: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
1.1       cgd       308:
1.90      christos  309: __archivebuild: .USE
1.89      christos  310:        @rm -f ${.TARGET}
1.138     tv        311:        @${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.89      christos  312:        ${RANLIB} ${.TARGET}
                    313:
                    314: __archiveinstall: .USE
1.156     simonb    315:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
                    316:            -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
1.89      christos  317:        ${RANLIB} -t ${.TARGET}
                    318:        chmod ${LIBMODE} ${.TARGET}
                    319:
1.104     mycroft   320: DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.128     tv        321: CLEANFILES+=   ${DPSRCS}
1.129     tv        322: .if defined(YHEADER)
                    323: CLEANFILES+=   ${SRCS:M*.y:.y=.h}
                    324: .endif
1.103     mycroft   325:
1.89      christos  326: lib${LIB}.a:: ${OBJS} __archivebuild
1.1       cgd       327:        @echo building standard ${LIB} library
                    328:
1.89      christos  329: lib${LIB}_p.a:: ${POBJS} __archivebuild
1.1       cgd       330:        @echo building profiled ${LIB} library
                    331:
1.89      christos  332: lib${LIB}_pic.a:: ${SOBJS} __archivebuild
1.27      pk        333:        @echo building shared object ${LIB} library
                    334:
1.169.2.4  kleink    335: lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
1.88      cgd       336:     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.169.2.4  kleink    337:        @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
                    338:        @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
1.152     fair      339: .if defined(DESTDIR)
1.155     wrstuden  340:        $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.152     fair      341:            ${SHLIB_LDSTARTFILE} \
1.160     simonb    342:            --whole-archive ${SOLIB} \
1.152     fair      343:            --no-whole-archive ${LDADD} \
1.169.2.1  thorpej   344:            -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
1.152     fair      345:            ${SHLIB_LDENDFILE}
                    346: .else
1.126     jonathan  347:        $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.123     jonathan  348:            ${SHLIB_LDSTARTFILE} \
1.160     simonb    349:            --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
1.115     cjs       350:            ${SHLIB_LDENDFILE}
1.152     fair      351: .endif
1.148     lukem     352: .if ${OBJECT_FMT} == "ELF"
1.135     tv        353:        rm -f lib${LIB}.so.${SHLIB_MAJOR}
1.169.2.4  kleink    354:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}
1.135     tv        355:        rm -f lib${LIB}.so
1.169.2.4  kleink    356:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so
1.133     tv        357: .endif
1.35      pk        358:
1.103     mycroft   359: LLIBS?=                -lc
1.58      cgd       360: llib-l${LIB}.ln: ${LOBJS}
                    361:        @echo building llib-l${LIB}.ln
                    362:        @rm -f llib-l${LIB}.ln
1.141     wrstuden  363:        @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.1       cgd       364:
1.81      cgd       365: cleanlib:
1.48      mycroft   366:        rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
1.59      cgd       367:        rm -f lib${LIB}.a ${OBJS}
                    368:        rm -f lib${LIB}_p.a ${POBJS}
1.133     tv        369:        rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
1.59      cgd       370:        rm -f llib-l${LIB}.ln ${LOBJS}
1.1       cgd       371:
1.26      mycroft   372: .if defined(SRCS)
1.64      christos  373: afterdepend: .depend
1.1       cgd       374:        @(TMP=/tmp/_depend$$$$; \
1.79      cgd       375:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
1.58      cgd       376:              < .depend > $$TMP; \
1.1       cgd       377:            mv $$TMP .depend)
1.26      mycroft   378: .endif
1.1       cgd       379:
1.97      mycroft   380: .if !target(libinstall)
1.148     lukem     381: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139     tv        382: libinstall::
                    383:
1.148     lukem     384: .if ${MKLINKLIB} != "no"
1.89      christos  385: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168     mycroft   386: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.89      christos  387: .if !defined(UPDATE)
                    388: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
                    389: .endif
1.168     mycroft   390:
1.157     fredb     391: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89      christos  392: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
                    393: .endif
                    394: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130     tv        395: .endif
1.89      christos  396:
1.149     lukem     397: .if ${MKPROFILE} != "no"
1.89      christos  398: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168     mycroft   399: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.89      christos  400: .if !defined(UPDATE)
                    401: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.32      pk        402: .endif
1.168     mycroft   403:
1.157     fredb     404: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89      christos  405: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
                    406: .endif
                    407: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
                    408: .endif
                    409:
1.149     lukem     410: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168     mycroft   411: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160     simonb    412: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.89      christos  413: .if !defined(UPDATE)
                    414: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    415: .endif
1.168     mycroft   416:
1.157     fredb     417: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89      christos  418: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33      pk        419: .endif
1.160     simonb    420: .if ${MKPICLIB} == "no"
                    421: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
                    422:        rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    423:        ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    424: .else
1.89      christos  425: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160     simonb    426: .endif
1.89      christos  427: .endif
                    428:
1.169.2.4  kleink    429: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
                    430: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
                    431: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89      christos  432: .if !defined(UPDATE)
1.169.2.4  kleink    433: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89      christos  434: .endif
1.168     mycroft   435:
1.169.2.4  kleink    436: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
                    437: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
1.89      christos  438: .endif
1.169.2.4  kleink    439: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.156     simonb    440:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
                    441:            -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
1.148     lukem     442: .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
1.146     thorpej   443:        /sbin/ldconfig -m ${LIBDIR}
                    444: .endif
1.148     lukem     445: .if ${OBJECT_FMT} == "ELF"
1.83      cgd       446:        rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
1.169.2.4  kleink    447:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \
1.83      cgd       448:            ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
                    449:        rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so
1.148     lukem     450: .if ${MKLINKLIB} != "no"
1.169.2.4  kleink    451:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \
1.83      cgd       452:            ${DESTDIR}${LIBDIR}/lib${LIB}.so
                    453: .endif
1.12      cgd       454: .endif
1.139     tv        455: .endif
1.89      christos  456:
1.148     lukem     457: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"
1.89      christos  458: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168     mycroft   459: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.89      christos  460: .if !defined(UPDATE)
                    461: .PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
                    462: .endif
1.168     mycroft   463:
1.157     fredb     464: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89      christos  465: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
                    466: .endif
1.95      mycroft   467: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.156     simonb    468:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
                    469:            -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58      cgd       470: .endif
1.1       cgd       471: .endif
                    472:
                    473: .include <bsd.man.mk>
1.57      jtc       474: .include <bsd.nls.mk>
1.91      christos  475: .include <bsd.files.mk>
1.89      christos  476: .include <bsd.inc.mk>
1.109     cjs       477: .include <bsd.links.mk>
1.24      mycroft   478: .include <bsd.dep.mk>
1.66      christos  479: .include <bsd.sys.mk>
1.117     mycroft   480:
                    481: # Make sure all of the standard targets are defined, even if they do nothing.
                    482: lint regress:

CVSweb <webmaster@jp.NetBSD.org>