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

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

CVSweb <webmaster@jp.NetBSD.org>