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

1.23      mycroft     1: #      from: @(#)bsd.lib.mk    5.26 (Berkeley) 5/2/91
1.24    ! mycroft     2: #      $Id: bsd.lib.mk,v 1.23 1993/08/15 19:37:06 mycroft 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
                     11: .SUFFIXES:
1.24    ! mycroft    12: .SUFFIXES: .out .o .po .s .c .cc .C .f .y .l .0 .1 .2 .3 .4 .5 .6 .7 .8
1.1       cgd        13:
                     14: .c.o:
                     15:        ${CC} ${CFLAGS} -c ${.IMPSRC}
                     16:        @${LD} -x -r ${.TARGET}
                     17:        @mv a.out ${.TARGET}
                     18:
                     19: .c.po:
                     20:        ${CC} -p ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
1.17      mycroft    21:        @${LD} -X -r ${.TARGET}
                     22:        @mv a.out ${.TARGET}
                     23:
1.18      mycroft    24: .cc.o .C.o:
1.17      mycroft    25:        ${CXX} ${CXXFLAGS} -c ${.IMPSRC}
                     26:        @${LD} -x -r ${.TARGET}
                     27:        @mv a.out ${.TARGET}
                     28:
1.18      mycroft    29: .cc.po .C.po:
1.17      mycroft    30:        ${CXX} -p ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
1.1       cgd        31:        @${LD} -X -r ${.TARGET}
                     32:        @mv a.out ${.TARGET}
                     33:
                     34: .s.o:
                     35:        ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
                     36:            ${AS} -o ${.TARGET}
                     37:        @${LD} -x -r ${.TARGET}
                     38:        @mv a.out ${.TARGET}
                     39:
                     40: .s.po:
                     41:        ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
                     42:            ${AS} -o ${.TARGET}
                     43:        @${LD} -X -r ${.TARGET}
                     44:        @mv a.out ${.TARGET}
                     45:
                     46: .if !defined(NOPROFILE)
                     47: _LIBS=lib${LIB}.a lib${LIB}_p.a
                     48: .else
                     49: _LIBS=lib${LIB}.a
                     50: .endif
                     51:
1.24    ! mycroft    52: all: ${_LIBS} # llib-l${LIB}.ln
1.1       cgd        53:
1.21      mycroft    54: OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
1.1       cgd        55:
                     56: lib${LIB}.a:: ${OBJS}
                     57:        @echo building standard ${LIB} library
                     58:        @rm -f lib${LIB}.a
1.16      mycroft    59:        @${AR} cTq lib${LIB}.a `lorder ${OBJS} | tsort` ${LDADD}
1.13      cgd        60:        ${RANLIB} lib${LIB}.a
1.1       cgd        61:
                     62: POBJS+=        ${OBJS:.o=.po}
                     63: lib${LIB}_p.a:: ${POBJS}
                     64:        @echo building profiled ${LIB} library
                     65:        @rm -f lib${LIB}_p.a
1.16      mycroft    66:        @${AR} cTq lib${LIB}_p.a `lorder ${POBJS} | tsort` ${LDADD}
1.13      cgd        67:        ${RANLIB} lib${LIB}_p.a
1.1       cgd        68:
                     69: llib-l${LIB}.ln: ${SRCS}
                     70:        ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
                     71:
                     72: .if !target(clean)
                     73: clean:
1.9       cgd        74:        rm -f a.out Errs errs mklog core ${CLEANFILES}
                     75:        rm -f ${OBJS}
                     76:        rm -f ${POBJS} profiled/*.o
                     77:        rm -f lib${LIB}.a lib${LIB}_p.a llib-l${LIB}.ln
1.1       cgd        78: .endif
                     79:
1.23      mycroft    80: afterdepend:
1.1       cgd        81:        @(TMP=/tmp/_depend$$$$; \
1.14      cgd        82:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po:/' < .depend > $$TMP; \
1.1       cgd        83:            mv $$TMP .depend)
                     84:
                     85: .if !target(install)
                     86: .if !target(beforeinstall)
                     87: beforeinstall:
1.22      mycroft    88:        @install -d -o root -g wheel -m 755 ${DESTDIR}${LIBDIR}
1.1       cgd        89: .endif
                     90:
1.11      mycroft    91: realinstall:
1.13      cgd        92: #      ranlib lib${LIB}.a
1.8       cgd        93:        install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} lib${LIB}.a \
1.1       cgd        94:            ${DESTDIR}${LIBDIR}
                     95:        ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.12      cgd        96: .if !defined(NOPROFILE)
1.13      cgd        97: #      ranlib lib${LIB}_p.a
1.8       cgd        98:        install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.1       cgd        99:            lib${LIB}_p.a ${DESTDIR}${LIBDIR}
                    100:        ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.12      cgd       101: .endif
1.8       cgd       102: #      install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.1       cgd       103: #          llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
                    104: .if defined(LINKS) && !empty(LINKS)
                    105:        @set ${LINKS}; \
                    106:        while test $$# -ge 2; do \
                    107:                l=${DESTDIR}$$1; \
                    108:                shift; \
                    109:                t=${DESTDIR}$$1; \
                    110:                shift; \
                    111:                echo $$t -\> $$l; \
                    112:                rm -f $$t; \
                    113:                ln $$l $$t; \
                    114:        done; true
                    115: .endif
                    116:
1.11      mycroft   117: install: maninstall
                    118: maninstall: afterinstall
                    119: afterinstall: realinstall
                    120: realinstall: beforeinstall
1.1       cgd       121: .endif
                    122:
1.24    ! mycroft   123: cleandir: clean
1.1       cgd       124:
1.10      mycroft   125: .if !defined(NOMAN)
1.1       cgd       126: .include <bsd.man.mk>
1.10      mycroft   127: .endif
                    128:
1.22      mycroft   129: .include <bsd.obj.mk>
1.24    ! mycroft   130: .include <bsd.dep.mk>
        !           131: .include <bsd.subdir.mk>

CVSweb <webmaster@jp.NetBSD.org>