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

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

CVSweb <webmaster@jp.NetBSD.org>