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

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

CVSweb <webmaster@jp.NetBSD.org>