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

1.23      mycroft     1: #      from: @(#)bsd.lib.mk    5.26 (Berkeley) 5/2/91
1.32    ! pk          2: #      $Id: bsd.lib.mk,v 1.31 1993/10/11 21:49:06 pk Exp $
1.1       cgd         3:
                      4: .if exists(${.CURDIR}/../Makefile.inc)
                      5: .include "${.CURDIR}/../Makefile.inc"
                      6: .endif
                      7:
                      8: .MAIN: all
                      9:
                     10: # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
1.27      pk         11: # .so used for PIC object files
1.1       cgd        12: .SUFFIXES:
1.27      pk         13: .SUFFIXES: .out .o .po .so .s .c .cc .C .f .y .l .0 .1 .2 .3 .4 .5 .6 .7 .8
1.1       cgd        14:
                     15: .c.o:
                     16:        ${CC} ${CFLAGS} -c ${.IMPSRC}
                     17:        @${LD} -x -r ${.TARGET}
                     18:        @mv a.out ${.TARGET}
                     19:
                     20: .c.po:
                     21:        ${CC} -p ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
1.17      mycroft    22:        @${LD} -X -r ${.TARGET}
                     23:        @mv a.out ${.TARGET}
                     24:
1.27      pk         25: .c.so:
                     26:        ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
                     27:
1.18      mycroft    28: .cc.o .C.o:
1.17      mycroft    29:        ${CXX} ${CXXFLAGS} -c ${.IMPSRC}
                     30:        @${LD} -x -r ${.TARGET}
                     31:        @mv a.out ${.TARGET}
                     32:
1.18      mycroft    33: .cc.po .C.po:
1.17      mycroft    34:        ${CXX} -p ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
1.28      cgd        35:        @${LD} -X -r ${.TARGET}
                     36:        @mv a.out ${.TARGET}
                     37:
                     38: .cc.so .C.so:
                     39:        ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
1.1       cgd        40:
                     41: .s.o:
                     42:        ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
                     43:            ${AS} -o ${.TARGET}
                     44:        @${LD} -x -r ${.TARGET}
                     45:        @mv a.out ${.TARGET}
                     46:
                     47: .s.po:
                     48:        ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
                     49:            ${AS} -o ${.TARGET}
                     50:        @${LD} -X -r ${.TARGET}
                     51:        @mv a.out ${.TARGET}
                     52:
1.27      pk         53: .s.so:
                     54:        ${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
                     55:            ${AS} -k -o ${.TARGET}
                     56:
1.1       cgd        57: .if !defined(NOPROFILE)
                     58: _LIBS=lib${LIB}.a lib${LIB}_p.a
                     59: .else
                     60: _LIBS=lib${LIB}.a
                     61: .endif
                     62:
1.27      pk         63: .if !defined(NOPIC)
                     64: _LIBS+=lib${LIB}_pic.a
                     65: .endif
                     66:
                     67: .if !defined(PICFLAG)
                     68: PICFLAG=-fpic
                     69: .endif
                     70:
1.24      mycroft    71: all: ${_LIBS} # llib-l${LIB}.ln
1.1       cgd        72:
1.21      mycroft    73: OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
1.1       cgd        74:
                     75: lib${LIB}.a:: ${OBJS}
                     76:        @echo building standard ${LIB} library
                     77:        @rm -f lib${LIB}.a
1.16      mycroft    78:        @${AR} cTq lib${LIB}.a `lorder ${OBJS} | tsort` ${LDADD}
1.13      cgd        79:        ${RANLIB} lib${LIB}.a
1.1       cgd        80:
                     81: POBJS+=        ${OBJS:.o=.po}
                     82: lib${LIB}_p.a:: ${POBJS}
                     83:        @echo building profiled ${LIB} library
                     84:        @rm -f lib${LIB}_p.a
1.16      mycroft    85:        @${AR} cTq lib${LIB}_p.a `lorder ${POBJS} | tsort` ${LDADD}
1.13      cgd        86:        ${RANLIB} lib${LIB}_p.a
1.1       cgd        87:
1.27      pk         88: SOBJS+=        ${OBJS:.o=.so}
                     89: lib${LIB}_pic.a:: ${SOBJS}
                     90:        @echo building shared object ${LIB} library
                     91:        @rm -f lib${LIB}_pic.a
                     92:        @${AR} cTq lib${LIB}_pic.a `lorder ${SOBJS} | tsort` ${LDADD}
                     93:        ${RANLIB} lib${LIB}_pic.a
                     94:
1.1       cgd        95: llib-l${LIB}.ln: ${SRCS}
                     96:        ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
                     97:
                     98: .if !target(clean)
                     99: clean:
1.9       cgd       100:        rm -f a.out Errs errs mklog core ${CLEANFILES}
                    101:        rm -f ${OBJS}
                    102:        rm -f ${POBJS} profiled/*.o
1.27      pk        103:        rm -f ${SOBJS} shared/*.o
1.30      cgd       104:        rm -f lib${LIB}.a lib${LIB}_p.a lib${LIB}_pic.a llib-l${LIB}.ln
1.1       cgd       105: .endif
                    106:
1.25      mycroft   107: cleandir: clean
                    108:
1.26      mycroft   109: .if defined(SRCS)
1.23      mycroft   110: afterdepend:
1.1       cgd       111:        @(TMP=/tmp/_depend$$$$; \
1.29      pk        112:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < .depend > $$TMP; \
1.1       cgd       113:            mv $$TMP .depend)
1.26      mycroft   114: .endif
1.1       cgd       115:
                    116: .if !target(install)
                    117: .if !target(beforeinstall)
                    118: beforeinstall:
1.22      mycroft   119:        @install -d -o root -g wheel -m 755 ${DESTDIR}${LIBDIR}
1.1       cgd       120: .endif
                    121:
1.11      mycroft   122: realinstall:
1.13      cgd       123: #      ranlib lib${LIB}.a
1.8       cgd       124:        install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} lib${LIB}.a \
1.1       cgd       125:            ${DESTDIR}${LIBDIR}
                    126:        ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.12      cgd       127: .if !defined(NOPROFILE)
1.13      cgd       128: #      ranlib lib${LIB}_p.a
1.8       cgd       129:        install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.1       cgd       130:            lib${LIB}_p.a ${DESTDIR}${LIBDIR}
                    131:        ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.32    ! pk        132: .endif
        !           133: .if !defined(NOPIC) && defined(INSTALL_PIC_ARCHIVE)
        !           134: #      ranlib lib${LIB}_pic.a
        !           135:        install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
        !           136:            lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
        !           137:        ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.12      cgd       138: .endif
1.8       cgd       139: #      install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.1       cgd       140: #          llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
                    141: .if defined(LINKS) && !empty(LINKS)
                    142:        @set ${LINKS}; \
                    143:        while test $$# -ge 2; do \
                    144:                l=${DESTDIR}$$1; \
                    145:                shift; \
                    146:                t=${DESTDIR}$$1; \
                    147:                shift; \
                    148:                echo $$t -\> $$l; \
                    149:                rm -f $$t; \
                    150:                ln $$l $$t; \
                    151:        done; true
                    152: .endif
                    153:
1.11      mycroft   154: install: maninstall
                    155: maninstall: afterinstall
                    156: afterinstall: realinstall
                    157: realinstall: beforeinstall
1.1       cgd       158: .endif
                    159:
1.10      mycroft   160: .if !defined(NOMAN)
1.1       cgd       161: .include <bsd.man.mk>
1.10      mycroft   162: .endif
                    163:
1.22      mycroft   164: .include <bsd.obj.mk>
1.24      mycroft   165: .include <bsd.dep.mk>

CVSweb <webmaster@jp.NetBSD.org>