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

1.57    ! mrg         1: #      $NetBSD: bsd.prog.mk,v 1.56 1996/10/18 02:34:47 thorpej 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: LIBKDB?=       ${DESTDIR}/usr/lib/libkdb.a
                     24: LIBKRB?=       ${DESTDIR}/usr/lib/libkrb.a
                     25: LIBKVM?=       ${DESTDIR}/usr/lib/libkvm.a
1.55      jtc        26: LIBL?=         ${DESTDIR}/usr/lib/libl.a
1.46      mycroft    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.57    ! mrg        36: LIBWRAP?=      ${DESTDIR}/usr/lib/libwrap.a
1.55      jtc        37: LIBY?=         ${DESTDIR}/usr/lib/liby.a
1.57    ! mrg        38: LIBZ?=         ${DESTDIR}/usr/lib/libz.a
1.1       cgd        39:
                     40: .if defined(SHAREDSTRINGS)
                     41: CLEANFILES+=strings
                     42: .c.o:
                     43:        ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
                     44:        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
                     45:        @rm -f x.c
1.18      mycroft    46:
                     47: .cc.o:
                     48:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     49:        @mv -f x.c x.cc
                     50:        @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26      mycroft    51:        @rm -f x.cc
1.18      mycroft    52:
                     53: .C.o:
                     54:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     55:        @mv -f x.c x.C
                     56:        @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26      mycroft    57:        @rm -f x.C
1.1       cgd        58: .endif
                     59:
1.38      jtc        60:
1.1       cgd        61: .if defined(PROG)
1.40      cgd        62: SRCS?= ${PROG}.c
1.45      cgd        63: .if !empty(SRCS:N*.h:N*.sh)
1.52      cgd        64: OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
                     65: LOBJS+=        ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd        66: .endif
1.1       cgd        67:
1.47      cgd        68: .if defined(OBJS) && !empty(OBJS)
1.46      mycroft    69: .if defined(DESTDIR)
1.4       nate       70:
1.26      mycroft    71: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.46      mycroft    72:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc
1.4       nate       73:
1.46      mycroft    74: .else
1.4       nate       75:
1.26      mycroft    76: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.32      cgd        77:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.1       cgd        78:
1.47      cgd        79: .endif # defined(DESTDIR)
                     80: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd        81:
1.49      cgd        82: .if    !defined(MAN)
                     83: MAN=   ${PROG}.1
                     84: .endif # !defined(MAN)
                     85: .endif # defined(PROG)
1.11      mycroft    86:
1.1       cgd        87: .MAIN: all
1.43      cgd        88: all: ${PROG} _SUBDIRUSE
1.1       cgd        89:
                     90: .if !target(clean)
1.43      cgd        91: clean: _SUBDIRUSE
1.53      cgd        92:        rm -f a.out [Ee]rrs mklog core *.core \
                     93:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd        94: .endif
                     95:
1.43      cgd        96: cleandir: _SUBDIRUSE clean
1.27      mycroft    97:
1.1       cgd        98: .if !target(install)
                     99: .if !target(beforeinstall)
                    100: beforeinstall:
                    101: .endif
                    102: .if !target(afterinstall)
                    103: afterinstall:
                    104: .endif
                    105:
1.14      mycroft   106: .if !target(realinstall)
1.26      mycroft   107: realinstall:
1.1       cgd       108: .if defined(PROG)
1.56      thorpej   109:        ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1.1       cgd       110:            ${PROG} ${DESTDIR}${BINDIR}
                    111: .endif
                    112: .if defined(HIDEGAME)
1.41      cgd       113:        (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG})
1.1       cgd       114: .endif
1.23      mycroft   115: .endif
                    116:
1.29      mycroft   117: install: maninstall _SUBDIRUSE
1.1       cgd       118: .if defined(LINKS) && !empty(LINKS)
                    119:        @set ${LINKS}; \
                    120:        while test $$# -ge 2; do \
                    121:                l=${DESTDIR}$$1; \
                    122:                shift; \
                    123:                t=${DESTDIR}$$1; \
                    124:                shift; \
                    125:                echo $$t -\> $$l; \
                    126:                rm -f $$t; \
                    127:                ln $$l $$t; \
                    128:        done; true
1.14      mycroft   129: .endif
1.1       cgd       130:
                    131: maninstall: afterinstall
                    132: afterinstall: realinstall
                    133: realinstall: beforeinstall
                    134: .endif
                    135:
                    136: .if !target(lint)
1.52      cgd       137: lint: ${LOBJS}
                    138: .if defined(LOBJS) && !empty(LOBJS)
                    139:        @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       140: .endif
                    141: .endif
                    142:
                    143: .if !defined(NOMAN)
                    144: .include <bsd.man.mk>
1.50      jtc       145: .endif
                    146:
                    147: .if !defined(NONLS)
                    148: .include <bsd.nls.mk>
1.1       cgd       149: .endif
1.24      mycroft   150:
                    151: .include <bsd.obj.mk>
1.26      mycroft   152: .include <bsd.dep.mk>
1.28      mycroft   153: .include <bsd.subdir.mk>
1.54      christos  154: .include <bsd.sys.mk>

CVSweb <webmaster@jp.NetBSD.org>