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

1.52    ! cgd         1: #      $NetBSD: bsd.prog.mk,v 1.51 1995/06/10 20:21:05 mycroft Exp $
1.44      cgd         2: #      @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
1.1       cgd         3:
                      4: .if exists(${.CURDIR}/../Makefile.inc)
                      5: .include "${.CURDIR}/../Makefile.inc"
                      6: .endif
1.48      mycroft     7:
                      8: .include <bsd.own.mk>
1.1       cgd         9:
1.18      mycroft    10: .SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
1.1       cgd        11:
1.25      mycroft    12: CFLAGS+=       ${COPTS}
1.1       cgd        13:
1.46      mycroft    14: LIBCRT0?=      ${DESTDIR}/usr/lib/crt0.o
                     15: LIBC?=         ${DESTDIR}/usr/lib/libc.a
                     16: LIBCOMPAT?=    ${DESTDIR}/usr/lib/libcompat.a
                     17: LIBCRYPT?=     ${DESTDIR}/usr/lib/libcrypt.a
                     18: LIBCURSES?=    ${DESTDIR}/usr/lib/libcurses.a
                     19: LIBDBM?=       ${DESTDIR}/usr/lib/libdbm.a
                     20: LIBDES?=       ${DESTDIR}/usr/lib/libdes.a
1.51      mycroft    21: LIBEDIT?=      ${DESTDIR}/usr/lib/libedit.a
1.46      mycroft    22: LIBGCC?=       ${DESTDIR}/usr/lib/libgcc.a
                     23: LIBL?=         ${DESTDIR}/usr/lib/libl.a
                     24: LIBKDB?=       ${DESTDIR}/usr/lib/libkdb.a
                     25: LIBKRB?=       ${DESTDIR}/usr/lib/libkrb.a
                     26: LIBKVM?=       ${DESTDIR}/usr/lib/libkvm.a
                     27: LIBM?=         ${DESTDIR}/usr/lib/libm.a
                     28: LIBMP?=                ${DESTDIR}/usr/lib/libmp.a
                     29: LIBPC?=                ${DESTDIR}/usr/lib/libpc.a
                     30: LIBPLOT?=      ${DESTDIR}/usr/lib/libplot.a
                     31: LIBRESOLV?=    ${DESTDIR}/usr/lib/libresolv.a
                     32: LIBRPCSVC?=    ${DESTDIR}/usr/lib/librpcsvc.a
                     33: LIBSKEY?=      ${DESTDIR}/usr/lib/libskey.a
                     34: LIBTERMCAP?=   ${DESTDIR}/usr/lib/libtermcap.a
                     35: LIBUTIL?=      ${DESTDIR}/usr/lib/libutil.a
1.1       cgd        36:
                     37: .if defined(SHAREDSTRINGS)
                     38: CLEANFILES+=strings
                     39: .c.o:
                     40:        ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
                     41:        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
                     42:        @rm -f x.c
1.18      mycroft    43:
                     44: .cc.o:
                     45:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     46:        @mv -f x.c x.cc
                     47:        @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26      mycroft    48:        @rm -f x.cc
1.18      mycroft    49:
                     50: .C.o:
                     51:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     52:        @mv -f x.c x.C
                     53:        @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26      mycroft    54:        @rm -f x.C
1.1       cgd        55: .endif
                     56:
1.38      jtc        57:
1.1       cgd        58: .if defined(PROG)
1.40      cgd        59: SRCS?= ${PROG}.c
1.45      cgd        60: .if !empty(SRCS:N*.h:N*.sh)
1.52    ! cgd        61: OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
        !            62: LOBJS+=        ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd        63: .endif
1.1       cgd        64:
1.47      cgd        65: .if defined(OBJS) && !empty(OBJS)
1.46      mycroft    66: .if defined(DESTDIR)
1.4       nate       67:
1.26      mycroft    68: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.46      mycroft    69:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc
1.4       nate       70:
1.46      mycroft    71: .else
1.4       nate       72:
1.26      mycroft    73: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.32      cgd        74:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.1       cgd        75:
1.47      cgd        76: .endif # defined(DESTDIR)
                     77: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd        78:
1.49      cgd        79: .if    !defined(MAN)
                     80: MAN=   ${PROG}.1
                     81: .endif # !defined(MAN)
                     82: .endif # defined(PROG)
1.11      mycroft    83:
1.1       cgd        84: .MAIN: all
1.43      cgd        85: all: ${PROG} _SUBDIRUSE
1.1       cgd        86:
                     87: .if !target(clean)
1.43      cgd        88: clean: _SUBDIRUSE
1.52    ! cgd        89:        rm -f a.out [Ee]rrs mklog core *.core
        !            90:        rm -f ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd        91: .endif
                     92:
1.43      cgd        93: cleandir: _SUBDIRUSE clean
1.27      mycroft    94:
1.1       cgd        95: .if !target(install)
                     96: .if !target(beforeinstall)
                     97: beforeinstall:
                     98: .endif
                     99: .if !target(afterinstall)
                    100: afterinstall:
                    101: .endif
                    102:
1.14      mycroft   103: .if !target(realinstall)
1.26      mycroft   104: realinstall:
1.1       cgd       105: .if defined(PROG)
1.9       cgd       106:        install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1.1       cgd       107:            ${PROG} ${DESTDIR}${BINDIR}
                    108: .endif
                    109: .if defined(HIDEGAME)
1.41      cgd       110:        (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG})
1.1       cgd       111: .endif
1.23      mycroft   112: .endif
                    113:
1.29      mycroft   114: install: maninstall _SUBDIRUSE
1.1       cgd       115: .if defined(LINKS) && !empty(LINKS)
                    116:        @set ${LINKS}; \
                    117:        while test $$# -ge 2; do \
                    118:                l=${DESTDIR}$$1; \
                    119:                shift; \
                    120:                t=${DESTDIR}$$1; \
                    121:                shift; \
                    122:                echo $$t -\> $$l; \
                    123:                rm -f $$t; \
                    124:                ln $$l $$t; \
                    125:        done; true
1.14      mycroft   126: .endif
1.1       cgd       127:
                    128: maninstall: afterinstall
                    129: afterinstall: realinstall
                    130: realinstall: beforeinstall
                    131: .endif
                    132:
                    133: .if !target(lint)
1.52    ! cgd       134: lint: ${LOBJS}
        !           135: .if defined(LOBJS) && !empty(LOBJS)
        !           136:        @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       137: .endif
                    138: .endif
                    139:
                    140: .if !defined(NOMAN)
                    141: .include <bsd.man.mk>
1.50      jtc       142: .endif
                    143:
                    144: .if !defined(NONLS)
                    145: .include <bsd.nls.mk>
1.1       cgd       146: .endif
1.24      mycroft   147:
                    148: .include <bsd.obj.mk>
1.26      mycroft   149: .include <bsd.dep.mk>
1.28      mycroft   150: .include <bsd.subdir.mk>

CVSweb <webmaster@jp.NetBSD.org>