[BACK]Return to bsd.prog.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Annotation of src/share/mk/bsd.prog.mk, Revision 1.29

1.25      mycroft     1: #      from: @(#)bsd.prog.mk   5.26 (Berkeley) 6/25/91
1.29    ! mycroft     2: #      $Id: bsd.prog.mk,v 1.28 1993/08/15 21:53:05 mycroft Exp $
1.1       cgd         3:
                      4: .if exists(${.CURDIR}/../Makefile.inc)
                      5: .include "${.CURDIR}/../Makefile.inc"
                      6: .endif
                      7:
1.18      mycroft     8: .SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
1.1       cgd         9:
1.25      mycroft    10: CFLAGS+=       ${COPTS}
1.1       cgd        11:
1.4       nate       12: LIBCRT0?=      /usr/lib/crt0.o
1.1       cgd        13: LIBC?=         /usr/lib/libc.a
                     14: LIBCOMPAT?=    /usr/lib/libcompat.a
1.15      cgd        15: .ifndef EXPORTABLE_SYSTEM
                     16: LIBCRYPT?=     /usr/lib/libcrypt.a
                     17: .endif
1.1       cgd        18: LIBCURSES?=    /usr/lib/libcurses.a
                     19: LIBDBM?=       /usr/lib/libdbm.a
                     20: LIBDES?=       /usr/lib/libdes.a
                     21: LIBL?=         /usr/lib/libl.a
                     22: LIBKDB?=       /usr/lib/libkdb.a
                     23: LIBKRB?=       /usr/lib/libkrb.a
                     24: LIBM?=         /usr/lib/libm.a
                     25: LIBMP?=                /usr/lib/libmp.a
                     26: LIBPC?=                /usr/lib/libpc.a
                     27: LIBPLOT?=      /usr/lib/libplot.a
                     28: LIBRESOLV?=    /usr/lib/libresolv.a
1.5       cgd        29: LIBRPC?=       /usr/lib/librpc.a
1.17      brezak     30: LIBRPCSVC?=    /usr/lib/librpcsvc.a
1.1       cgd        31: LIBTERM?=      /usr/lib/libterm.a
                     32: LIBUTIL?=      /usr/lib/libutil.a
                     33:
                     34: .if defined(SHAREDSTRINGS)
                     35: CLEANFILES+=strings
                     36: .c.o:
                     37:        ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
                     38:        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
                     39:        @rm -f x.c
1.18      mycroft    40:
                     41: .cc.o:
                     42:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     43:        @mv -f x.c x.cc
                     44:        @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26      mycroft    45:        @rm -f x.cc
1.18      mycroft    46:
                     47: .C.o:
                     48:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     49:        @mv -f x.c x.C
                     50:        @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26      mycroft    51:        @rm -f x.C
1.1       cgd        52: .endif
                     53:
                     54: .if defined(PROG)
                     55: .if defined(SRCS)
                     56:
1.22      mycroft    57: OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
1.1       cgd        58:
1.4       nate       59: .if defined(LDONLY)
                     60:
1.26      mycroft    61: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.4       nate       62:        ${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDADD}
                     63:
                     64: .else defined(LDONLY)
                     65:
1.26      mycroft    66: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.1       cgd        67:        ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
                     68:
1.4       nate       69: .endif
                     70:
1.26      mycroft    71: .else
1.1       cgd        72:
1.26      mycroft    73: SRCS=  ${PROG}.c
1.1       cgd        74:
                     75: ${PROG}: ${SRCS} ${LIBC} ${DPADD}
1.13      mycroft    76:        ${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}
1.1       cgd        77:
                     78: MKDEP= -p
                     79:
                     80: .endif
                     81:
                     82: .if    !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
                     83:        !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
1.10      mycroft    84:        !defined(MAN7) && !defined(MAN8)
1.1       cgd        85: MAN1=  ${PROG}.0
                     86: .endif
                     87: .endif
1.11      mycroft    88:
1.1       cgd        89: .MAIN: all
1.26      mycroft    90: all: ${PROG}
1.1       cgd        91:
                     92: .if !target(clean)
1.26      mycroft    93: clean:
1.8       cgd        94:        rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
1.1       cgd        95: .endif
                     96:
1.27      mycroft    97: cleandir: clean
                     98:
1.1       cgd        99: .if !target(install)
                    100: .if !target(beforeinstall)
                    101: beforeinstall:
1.12      mycroft   102: .if defined(DESTDIR) || defined(BINDIR)
1.24      mycroft   103:        @install -d -o root -g wheel -m 755 ${DESTDIR}${BINDIR}
1.12      mycroft   104: .endif
1.1       cgd       105: .endif
                    106: .if !target(afterinstall)
                    107: afterinstall:
                    108: .endif
                    109:
1.14      mycroft   110: .if !target(realinstall)
1.26      mycroft   111: realinstall:
1.1       cgd       112: .if defined(PROG)
1.9       cgd       113:        install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1.1       cgd       114:            ${PROG} ${DESTDIR}${BINDIR}
                    115: .endif
                    116: .if defined(HIDEGAME)
                    117:        (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \
                    118:            chown games.bin ${PROG})
                    119: .endif
1.23      mycroft   120: .endif
                    121:
1.29    ! mycroft   122: install: maninstall _SUBDIRUSE
1.1       cgd       123: .if defined(LINKS) && !empty(LINKS)
                    124:        @set ${LINKS}; \
                    125:        while test $$# -ge 2; do \
                    126:                l=${DESTDIR}$$1; \
                    127:                shift; \
                    128:                t=${DESTDIR}$$1; \
                    129:                shift; \
                    130:                echo $$t -\> $$l; \
                    131:                rm -f $$t; \
                    132:                ln $$l $$t; \
                    133:        done; true
1.14      mycroft   134: .endif
1.1       cgd       135:
                    136: maninstall: afterinstall
                    137: afterinstall: realinstall
                    138: realinstall: beforeinstall
                    139: .endif
                    140:
                    141: .if !target(lint)
1.26      mycroft   142: lint: ${SRCS}
1.1       cgd       143: .if defined(PROG)
                    144:        @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1
                    145: .endif
                    146: .endif
                    147:
                    148: .if !defined(NOMAN)
                    149: .include <bsd.man.mk>
                    150: .endif
1.24      mycroft   151:
                    152: .include <bsd.obj.mk>
1.26      mycroft   153: .include <bsd.dep.mk>
1.28      mycroft   154: .include <bsd.subdir.mk>

CVSweb <webmaster@jp.NetBSD.org>