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

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

CVSweb <webmaster@jp.NetBSD.org>