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

1.23      mycroft     1: #      from: @(#)bsd.lib.mk    5.26 (Berkeley) 5/2/91
1.26    ! mycroft     2: #      $Id: bsd.lib.mk,v 1.25 1993/08/15 20:59:36 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.25      mycroft    80: cleandir: clean
                     81:
1.26    ! mycroft    82: .if defined(SRCS)
1.23      mycroft    83: afterdepend:
1.1       cgd        84:        @(TMP=/tmp/_depend$$$$; \
1.14      cgd        85:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po:/' < .depend > $$TMP; \
1.1       cgd        86:            mv $$TMP .depend)
1.26    ! mycroft    87: .endif
1.1       cgd        88:
                     89: .if !target(install)
                     90: .if !target(beforeinstall)
                     91: beforeinstall:
1.22      mycroft    92:        @install -d -o root -g wheel -m 755 ${DESTDIR}${LIBDIR}
1.1       cgd        93: .endif
                     94:
1.11      mycroft    95: realinstall:
1.13      cgd        96: #      ranlib lib${LIB}.a
1.8       cgd        97:        install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} lib${LIB}.a \
1.1       cgd        98:            ${DESTDIR}${LIBDIR}
                     99:        ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.12      cgd       100: .if !defined(NOPROFILE)
1.13      cgd       101: #      ranlib lib${LIB}_p.a
1.8       cgd       102:        install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.1       cgd       103:            lib${LIB}_p.a ${DESTDIR}${LIBDIR}
                    104:        ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.12      cgd       105: .endif
1.8       cgd       106: #      install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.1       cgd       107: #          llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
                    108: .if defined(LINKS) && !empty(LINKS)
                    109:        @set ${LINKS}; \
                    110:        while test $$# -ge 2; do \
                    111:                l=${DESTDIR}$$1; \
                    112:                shift; \
                    113:                t=${DESTDIR}$$1; \
                    114:                shift; \
                    115:                echo $$t -\> $$l; \
                    116:                rm -f $$t; \
                    117:                ln $$l $$t; \
                    118:        done; true
                    119: .endif
                    120:
1.11      mycroft   121: install: maninstall
                    122: maninstall: afterinstall
                    123: afterinstall: realinstall
                    124: realinstall: beforeinstall
1.1       cgd       125: .endif
                    126:
1.10      mycroft   127: .if !defined(NOMAN)
1.1       cgd       128: .include <bsd.man.mk>
1.10      mycroft   129: .endif
                    130:
1.22      mycroft   131: .include <bsd.obj.mk>
1.24      mycroft   132: .include <bsd.dep.mk>

CVSweb <webmaster@jp.NetBSD.org>