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

1.174   ! eeh         1: #      $NetBSD: bsd.lib.mk,v 1.173 2000/07/14 19:53:04 christos 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.171     christos   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.154     simonb     29:                ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
                     30:                    -d ${DESTDIR}${LIBDIR} ${LIB})
1.173     christos   31: .endif
                     32: .endif
                     33:
                     34: .if !target(checkver)
1.143     erh        35: checkver:
                     36: .endif
1.173     christos   37:
1.169     thorpej    38: print-shlib-major:
1.173     christos   39: .if defined(SHLIB_MAJOR)
1.169     thorpej    40:        @echo ${SHLIB_MAJOR}
1.173     christos   41: .else
                     42:        @false
                     43: .endif
1.169     thorpej    44:
                     45: print-shlib-minor:
1.173     christos   46: .if defined(SHLIB_MINOR)
1.169     thorpej    47:        @echo ${SHLIB_MINOR}
1.173     christos   48: .else
                     49:        @false
                     50: .endif
1.171     christos   51:
                     52: print-shlib-teeny:
1.173     christos   53: .if defined(SHLIB_TEENY)
1.171     christos   54:        @echo ${SHLIB_TEENY}
1.143     erh        55: .else
1.169     thorpej    56:        @false
1.173     christos   57: .endif
1.169     thorpej    58:
1.173     christos   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.173     christos   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.172     matt      114:
                    115: .elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
                    116: # On the VAX, all object are PIC by default, not just sharedlibs.
                    117: MKPICLIB= no
1.150     christos  118:
                    119: .elif ${MACHINE_ARCH} == "sparc" && ${OBJECT_FMT} == "ELF"
1.174   ! eeh       120:
        !           121: CPICFLAGS ?= -fPIC -DPIC
        !           122: CPPPICFLAGS?= -DPIC
        !           123: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
        !           124: APICFLAGS ?= -KPIC
        !           125:
        !           126: .elif ${MACHINE_ARCH} == "sparc64" && ${OBJECT_FMT} == "ELF"
1.150     christos  127:
1.165     dmcmahil  128: CPICFLAGS ?= -fPIC -DPIC
1.150     christos  129: CPPPICFLAGS?= -DPIC
                    130: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    131: APICFLAGS ?= -KPIC
1.86      jonathan  132:
                    133: .else
                    134:
1.125     jonathan  135: # Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
1.88      cgd       136: SHLIB_LDSTARTFILE=
                    137: SHLIB_LDENDFILE=
1.171     christos  138: SHLIB_SOVERSION=${SHLIB_FULLVERSION}
1.125     jonathan  139: SHLIB_SHFLAGS=
1.165     dmcmahil  140: CPICFLAGS?= -fPIC -DPIC
1.107     jonathan  141: CPPPICFLAGS?= -DPIC
                    142: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
                    143: APICFLAGS?= -k
1.86      jonathan  144:
                    145: .endif
                    146:
1.160     simonb    147: MKPICLIB?= yes
                    148:
1.123     jonathan  149: # Platform-independent linker flags for ELF shared libraries
1.148     lukem     150: .if ${OBJECT_FMT} == "ELF"
1.123     jonathan  151: SHLIB_SOVERSION=${SHLIB_MAJOR}
1.125     jonathan  152: SHLIB_SHFLAGS=-soname lib${LIB}.so.${SHLIB_SOVERSION}
1.142     jonathan  153: SHLIB_LDSTARTFILE= ${DESTDIR}/usr/lib/crtbeginS.o
                    154: SHLIB_LDENDFILE= ${DESTDIR}/usr/lib/crtendS.o
1.123     jonathan  155: .endif
1.86      jonathan  156:
1.82      mikel     157: CFLAGS+=       ${COPTS}
1.1       cgd       158:
                    159: .c.o:
1.153     christos  160: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    161:        ${COMPILE.c} ${.IMPSRC}
                    162: .else
1.80      christos  163:        @echo ${COMPILE.c:Q} ${.IMPSRC}
1.122     cgd       164:        @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  165:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    166:        @rm -f ${.TARGET}.o
1.153     christos  167: .endif
1.1       cgd       168:
                    169: .c.po:
1.153     christos  170: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    171:        ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
                    172: .else
1.80      christos  173:        @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68      cgd       174:        @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  175:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    176:        @rm -f ${.TARGET}.o
1.153     christos  177: .endif
1.17      mycroft   178:
1.27      pk        179: .c.so:
1.153     christos  180: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    181:        ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    182: .else
1.86      jonathan  183:        @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    184:        @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  185:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    186:        @rm -f ${.TARGET}.o
1.153     christos  187: .endif
1.27      pk        188:
1.58      cgd       189: .c.ln:
1.121     thorpej   190:        ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
1.58      cgd       191:
1.18      mycroft   192: .cc.o .C.o:
1.153     christos  193: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    194:        ${COMPILE.cc} ${.IMPSRC}
                    195: .else
1.80      christos  196:        @echo ${COMPILE.cc:Q} ${.IMPSRC}
1.62      christos  197:        @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
1.63      jtc       198:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1.62      christos  199:        @rm -f ${.TARGET}.o
1.153     christos  200: .endif
1.17      mycroft   201:
1.18      mycroft   202: .cc.po .C.po:
1.153     christos  203: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    204:        ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
                    205: .else
1.80      christos  206:        @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68      cgd       207:        @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  208:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    209:        @rm -f ${.TARGET}.o
1.153     christos  210: .endif
1.28      cgd       211:
                    212: .cc.so .C.so:
1.153     christos  213: .if defined(COPTS) && !empty(COPTS:M*-g*)
                    214:        ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    215: .else
1.86      jonathan  216:        @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    217:        @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  218:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    219:        @rm -f ${.TARGET}.o
1.153     christos  220: .endif
1.118     lukem     221:
                    222: .m.o:
1.153     christos  223: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    224:        ${COMPILE.m} ${.IMPSRC}
                    225: .else
1.118     lukem     226:        @echo ${COMPILE.m:Q} ${.IMPSRC}
1.122     cgd       227:        @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
1.118     lukem     228:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    229:        @rm -f ${.TARGET}.o
1.153     christos  230: .endif
1.118     lukem     231:
                    232: .m.po:
1.153     christos  233: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    234:        ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
                    235: .else
1.118     lukem     236:        @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
                    237:        @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
                    238:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    239:        @rm -f ${.TARGET}.o
1.153     christos  240: .endif
1.118     lukem     241:
                    242: .m.so:
1.153     christos  243: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
                    244:        ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    245: .else
1.118     lukem     246:        @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
                    247:        @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
                    248:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    249:        @rm -f ${.TARGET}.o
1.153     christos  250: .endif
1.1       cgd       251:
1.40      cgd       252: .S.o .s.o:
1.80      christos  253:        @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
1.69      jtc       254:        @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  255:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    256:        @rm -f ${.TARGET}.o
1.1       cgd       257:
1.40      cgd       258: .S.po .s.po:
1.80      christos  259:        @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
1.75      jtc       260:        @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  261:        @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
                    262:        @rm -f ${.TARGET}.o
1.1       cgd       263:
1.40      cgd       264: .S.so .s.so:
1.107     jonathan  265:        @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
                    266:        @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62      christos  267:        @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
                    268:        @rm -f ${.TARGET}.o
1.27      pk        269:
1.148     lukem     270: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    271:        || ${MKLINKLIB} != "no"
1.130     tv        272: _LIBS=lib${LIB}.a
                    273: .else
                    274: _LIBS=
                    275: .endif
1.58      cgd       276:
1.167     matt      277: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.158     christos  278:
1.149     lukem     279: .if ${MKPROFILE} != "no"
1.130     tv        280: _LIBS+=lib${LIB}_p.a
1.167     matt      281: POBJS+=${OBJS:.o=.po}
1.1       cgd       282: .endif
                    283:
1.148     lukem     284: .if ${MKPIC} != "no"
1.160     simonb    285: .if ${MKPICLIB} == "no"
                    286: SOLIB=lib${LIB}.a
                    287: .else
                    288: SOLIB=lib${LIB}_pic.a
                    289: _LIBS+=${SOLIB}
1.167     matt      290: SOBJS+=${OBJS:.o=.so}
1.160     simonb    291: .endif
1.171     christos  292: .if defined(SHLIB_FULLVERSION)
                    293: _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
1.27      pk        294: .endif
1.35      pk        295: .endif
1.27      pk        296:
1.148     lukem     297: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"
1.58      cgd       298: _LIBS+=llib-l${LIB}.ln
1.158     christos  299: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.27      pk        300: .endif
                    301:
1.167     matt      302: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
                    303:        || ${MKLINKLIB} != "no"
1.158     christos  304: ALLOBJS=${OBJS} ${POBJS} ${SOBJS} ${LOBJS}
1.167     matt      305: .else
                    306: ALLOBJS=${POBJS} ${SOBJS} ${LOBJS}
                    307: .endif
1.163     erh       308: .NOPATH: ${ALLOBJS} ${_LIBS}
1.158     christos  309:
1.162     mycroft   310: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
1.1       cgd       311:
1.90      christos  312: __archivebuild: .USE
1.89      christos  313:        @rm -f ${.TARGET}
1.138     tv        314:        @${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.89      christos  315:        ${RANLIB} ${.TARGET}
                    316:
                    317: __archiveinstall: .USE
1.156     simonb    318:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
                    319:            -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
1.89      christos  320:        ${RANLIB} -t ${.TARGET}
                    321:        chmod ${LIBMODE} ${.TARGET}
                    322:
1.104     mycroft   323: DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.128     tv        324: CLEANFILES+=   ${DPSRCS}
1.129     tv        325: .if defined(YHEADER)
                    326: CLEANFILES+=   ${SRCS:M*.y:.y=.h}
                    327: .endif
1.103     mycroft   328:
1.89      christos  329: lib${LIB}.a:: ${OBJS} __archivebuild
1.1       cgd       330:        @echo building standard ${LIB} library
                    331:
1.89      christos  332: lib${LIB}_p.a:: ${POBJS} __archivebuild
1.1       cgd       333:        @echo building profiled ${LIB} library
                    334:
1.89      christos  335: lib${LIB}_pic.a:: ${SOBJS} __archivebuild
1.27      pk        336:        @echo building shared object ${LIB} library
                    337:
1.171     christos  338: lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
1.88      cgd       339:     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.171     christos  340:        @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
                    341:        @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
1.152     fair      342: .if defined(DESTDIR)
1.155     wrstuden  343:        $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.152     fair      344:            ${SHLIB_LDSTARTFILE} \
1.160     simonb    345:            --whole-archive ${SOLIB} \
1.170     erh       346:            --no-whole-archive ${LDADD} \
1.155     wrstuden  347:            -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
1.152     fair      348:            ${SHLIB_LDENDFILE}
                    349: .else
1.126     jonathan  350:        $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.123     jonathan  351:            ${SHLIB_LDSTARTFILE} \
1.160     simonb    352:            --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
1.115     cjs       353:            ${SHLIB_LDENDFILE}
1.152     fair      354: .endif
1.148     lukem     355: .if ${OBJECT_FMT} == "ELF"
1.135     tv        356:        rm -f lib${LIB}.so.${SHLIB_MAJOR}
1.171     christos  357:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}
1.135     tv        358:        rm -f lib${LIB}.so
1.171     christos  359:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so
1.133     tv        360: .endif
1.35      pk        361:
1.103     mycroft   362: LLIBS?=                -lc
1.58      cgd       363: llib-l${LIB}.ln: ${LOBJS}
                    364:        @echo building llib-l${LIB}.ln
                    365:        @rm -f llib-l${LIB}.ln
1.141     wrstuden  366:        @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.1       cgd       367:
1.81      cgd       368: cleanlib:
1.48      mycroft   369:        rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
1.59      cgd       370:        rm -f lib${LIB}.a ${OBJS}
                    371:        rm -f lib${LIB}_p.a ${POBJS}
1.133     tv        372:        rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
1.59      cgd       373:        rm -f llib-l${LIB}.ln ${LOBJS}
1.1       cgd       374:
1.26      mycroft   375: .if defined(SRCS)
1.64      christos  376: afterdepend: .depend
1.1       cgd       377:        @(TMP=/tmp/_depend$$$$; \
1.79      cgd       378:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
1.58      cgd       379:              < .depend > $$TMP; \
1.1       cgd       380:            mv $$TMP .depend)
1.26      mycroft   381: .endif
1.1       cgd       382:
1.97      mycroft   383: .if !target(libinstall)
1.148     lukem     384: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139     tv        385: libinstall::
                    386:
1.148     lukem     387: .if ${MKLINKLIB} != "no"
1.89      christos  388: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168     mycroft   389: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.89      christos  390: .if !defined(UPDATE)
                    391: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
                    392: .endif
1.168     mycroft   393:
1.157     fredb     394: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89      christos  395: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
                    396: .endif
                    397: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130     tv        398: .endif
1.89      christos  399:
1.149     lukem     400: .if ${MKPROFILE} != "no"
1.89      christos  401: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168     mycroft   402: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.89      christos  403: .if !defined(UPDATE)
                    404: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.32      pk        405: .endif
1.168     mycroft   406:
1.157     fredb     407: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89      christos  408: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
                    409: .endif
                    410: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
                    411: .endif
                    412:
1.149     lukem     413: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168     mycroft   414: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160     simonb    415: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.89      christos  416: .if !defined(UPDATE)
                    417: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    418: .endif
1.168     mycroft   419:
1.157     fredb     420: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89      christos  421: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33      pk        422: .endif
1.160     simonb    423: .if ${MKPICLIB} == "no"
                    424: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
                    425:        rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    426:        ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
                    427: .else
1.89      christos  428: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160     simonb    429: .endif
1.89      christos  430: .endif
                    431:
1.171     christos  432: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
                    433: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
                    434: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89      christos  435: .if !defined(UPDATE)
1.171     christos  436: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89      christos  437: .endif
1.168     mycroft   438:
1.171     christos  439: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
                    440: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
1.89      christos  441: .endif
1.171     christos  442: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.156     simonb    443:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
                    444:            -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
1.148     lukem     445: .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
1.146     thorpej   446:        /sbin/ldconfig -m ${LIBDIR}
                    447: .endif
1.148     lukem     448: .if ${OBJECT_FMT} == "ELF"
1.83      cgd       449:        rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
1.171     christos  450:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \
1.83      cgd       451:            ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
                    452:        rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so
1.148     lukem     453: .if ${MKLINKLIB} != "no"
1.171     christos  454:        ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \
1.83      cgd       455:            ${DESTDIR}${LIBDIR}/lib${LIB}.so
                    456: .endif
1.12      cgd       457: .endif
1.139     tv        458: .endif
1.89      christos  459:
1.148     lukem     460: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"
1.89      christos  461: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168     mycroft   462: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.89      christos  463: .if !defined(UPDATE)
                    464: .PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
                    465: .endif
1.168     mycroft   466:
1.157     fredb     467: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89      christos  468: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
                    469: .endif
1.95      mycroft   470: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.156     simonb    471:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
                    472:            -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58      cgd       473: .endif
1.1       cgd       474: .endif
                    475:
                    476: .include <bsd.man.mk>
1.57      jtc       477: .include <bsd.nls.mk>
1.91      christos  478: .include <bsd.files.mk>
1.89      christos  479: .include <bsd.inc.mk>
1.109     cjs       480: .include <bsd.links.mk>
1.24      mycroft   481: .include <bsd.dep.mk>
1.66      christos  482: .include <bsd.sys.mk>
1.117     mycroft   483:
                    484: # Make sure all of the standard targets are defined, even if they do nothing.
                    485: lint regress:

CVSweb <webmaster@jp.NetBSD.org>