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

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

CVSweb <webmaster@jp.NetBSD.org>