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

1.104   ! perry       1: #      $NetBSD: bsd.prog.mk,v 1.103 1999/09/04 21:48:33 fredb Exp $
1.67      mikel       2: #      @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
1.1       cgd         3:
1.88      mycroft     4: .if !target(__initialized__)
                      5: __initialized__:
1.1       cgd         6: .if exists(${.CURDIR}/../Makefile.inc)
                      7: .include "${.CURDIR}/../Makefile.inc"
                      8: .endif
1.74      mycroft     9: .include <bsd.own.mk>
1.88      mycroft    10: .include <bsd.obj.mk>
1.104   ! perry      11: .include <bsd.depall.mk>
1.88      mycroft    12: .MAIN:         all
                     13: .endif
1.74      mycroft    14:
                     15: .PHONY:                cleanprog proginstall scriptsinstall
1.80      mycroft    16: realinstall:   proginstall scriptsinstall
1.94      lukem      17: clean cleandir distclean: cleanprog
1.1       cgd        18:
1.25      mycroft    19: CFLAGS+=       ${COPTS}
1.1       cgd        20:
1.69      thorpej    21: # ELF platforms depend on crtbegin.o and crtend.o
1.100     lukem      22: .if ${OBJECT_FMT} == "ELF"
1.86      cjs        23: LIBCRTBEGIN?=  ${DESTDIR}/usr/lib/crtbegin.o
                     24: LIBCRTEND?=    ${DESTDIR}/usr/lib/crtend.o
1.69      thorpej    25: .else
                     26: LIBCRTBEGIN?=
                     27: LIBCRTEND?=
                     28: .endif
                     29:
1.86      cjs        30: LIBCRT0?=      ${DESTDIR}/usr/lib/crt0.o
1.95      ross       31:
                     32: LIBBZ2?=       ${DESTDIR}/usr/lib/libbz2.a
1.86      cjs        33: LIBC?=         ${DESTDIR}/usr/lib/libc.a
                     34: LIBC_PIC?=     ${DESTDIR}/usr/lib/libc_pic.a
                     35: LIBCOMPAT?=    ${DESTDIR}/usr/lib/libcompat.a
                     36: LIBCRYPT?=     ${DESTDIR}/usr/lib/libcrypt.a
                     37: LIBCURSES?=    ${DESTDIR}/usr/lib/libcurses.a
                     38: LIBDBM?=       ${DESTDIR}/usr/lib/libdbm.a
                     39: LIBDES?=       ${DESTDIR}/usr/lib/libdes.a
                     40: LIBEDIT?=      ${DESTDIR}/usr/lib/libedit.a
                     41: LIBGCC?=       ${DESTDIR}/usr/lib/libgcc.a
                     42: LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1.101     itojun     43: LIBIPSEC?=     ${DESTDIR}/usr/lib/libipsec.a
1.86      cjs        44: LIBKDB?=       ${DESTDIR}/usr/lib/libkdb.a
                     45: LIBKRB?=       ${DESTDIR}/usr/lib/libkrb.a
                     46: LIBKVM?=       ${DESTDIR}/usr/lib/libkvm.a
                     47: LIBL?=         ${DESTDIR}/usr/lib/libl.a
                     48: LIBM?=         ${DESTDIR}/usr/lib/libm.a
                     49: LIBMP?=                ${DESTDIR}/usr/lib/libmp.a
                     50: LIBNTP?=       ${DESTDIR}/usr/lib/libntp.a
1.89      lukem      51: LIBOBJC?=      ${DESTDIR}/usr/lib/libobjc.a
1.86      cjs        52: LIBPC?=                ${DESTDIR}/usr/lib/libpc.a
                     53: LIBPCAP?=      ${DESTDIR}/usr/lib/libpcap.a
                     54: LIBPLOT?=      ${DESTDIR}/usr/lib/libplot.a
                     55: LIBPOSIX?=     ${DESTDIR}/usr/lib/libposix.a
                     56: LIBRESOLV?=    ${DESTDIR}/usr/lib/libresolv.a
                     57: LIBRPCSVC?=    ${DESTDIR}/usr/lib/librpcsvc.a
                     58: LIBSKEY?=      ${DESTDIR}/usr/lib/libskey.a
                     59: LIBTERMCAP?=   ${DESTDIR}/usr/lib/libtermcap.a
                     60: LIBTELNET?=    ${DESTDIR}/usr/lib/libtelnet.a
                     61: LIBUTIL?=      ${DESTDIR}/usr/lib/libutil.a
                     62: LIBWRAP?=      ${DESTDIR}/usr/lib/libwrap.a
                     63: LIBY?=         ${DESTDIR}/usr/lib/liby.a
                     64: LIBZ?=         ${DESTDIR}/usr/lib/libz.a
1.1       cgd        65:
                     66: .if defined(SHAREDSTRINGS)
                     67: CLEANFILES+=strings
                     68: .c.o:
                     69:        ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
                     70:        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
                     71:        @rm -f x.c
1.18      mycroft    72:
                     73: .cc.o:
                     74:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     75:        @mv -f x.c x.cc
                     76:        @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26      mycroft    77:        @rm -f x.cc
1.18      mycroft    78:
                     79: .C.o:
                     80:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     81:        @mv -f x.c x.C
                     82:        @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26      mycroft    83:        @rm -f x.C
1.1       cgd        84: .endif
                     85:
1.38      jtc        86:
1.1       cgd        87: .if defined(PROG)
1.80      mycroft    88: SRCS?=         ${PROG}.c
                     89:
1.81      mycroft    90: DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.92      tv         91: CLEANFILES+=   ${DPSRCS}
1.93      tv         92: .if defined(YHEADER)
                     93: CLEANFILES+=   ${SRCS:M*.y:.y=.h}
                     94: .endif
1.80      mycroft    95:
1.45      cgd        96: .if !empty(SRCS:N*.h:N*.sh)
1.80      mycroft    97: OBJS+=         ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
                     98: LOBJS+=                ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd        99: .endif
1.1       cgd       100:
1.47      cgd       101: .if defined(OBJS) && !empty(OBJS)
1.76      gwr       102: .NOPATH: ${OBJS}
1.86      cjs       103: .if defined(DESTDIR)
                    104:
1.80      mycroft   105: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.86      cjs       106:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND}
1.4       nate      107:
1.46      mycroft   108: .else
1.86      cjs       109:
1.80      mycroft   110: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.32      cgd       111:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.1       cgd       112:
1.86      cjs       113: .endif # defined(DESTDIR)
1.47      cgd       114: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd       115:
1.100     lukem     116: .if !defined(MAN)
1.49      cgd       117: MAN=   ${PROG}.1
                    118: .endif # !defined(MAN)
                    119: .endif # defined(PROG)
1.11      mycroft   120:
1.80      mycroft   121: all: ${PROG}
1.1       cgd       122:
1.60      cgd       123: cleanprog:
1.53      cgd       124:        rm -f a.out [Ee]rrs mklog core *.core \
                    125:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd       126:
1.59      cgd       127: .if defined(SRCS)
                    128: afterdepend: .depend
                    129:        @(TMP=/tmp/_depend$$$$; \
                    130:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                    131:              < .depend > $$TMP; \
                    132:            mv $$TMP .depend)
                    133: .endif
1.27      mycroft   134:
1.74      mycroft   135: .if defined(PROG) && !target(proginstall)
1.63      christos  136: PROGNAME?= ${PROG}
                    137: proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
                    138: .if !defined(UPDATE)
                    139: .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
                    140: .endif
1.103     fredb     141: .if !defined(BUILD) && !make(all) && !make(${PROG})
1.63      christos  142: ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
                    143: .endif
                    144:
1.72      mycroft   145: .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
1.63      christos  146: ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}
1.102     simonb    147:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
                    148:            -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
1.23      mycroft   149: .endif
                    150:
1.74      mycroft   151: .if !target(proginstall)
                    152: proginstall::
                    153: .endif
                    154:
                    155: .if defined(SCRIPTS) && !target(scriptsinstall)
1.65      mycroft   156: SCRIPTSDIR?=${BINDIR}
                    157: SCRIPTSOWN?=${BINOWN}
                    158: SCRIPTSGRP?=${BINGRP}
                    159: SCRIPTSMODE?=${BINMODE}
1.63      christos  160: .for S in ${SCRIPTS}
1.65      mycroft   161: SCRIPTSDIR_${S}?=${SCRIPTSDIR}
                    162: SCRIPTSOWN_${S}?=${SCRIPTSOWN}
                    163: SCRIPTSGRP_${S}?=${SCRIPTSGRP}
                    164: SCRIPTSMODE_${S}?=${SCRIPTSMODE}
1.63      christos  165: .if defined(SCRIPTSNAME)
                    166: SCRIPTSNAME_${S} ?= ${SCRIPTSNAME}
                    167: .else
                    168: SCRIPTSNAME_${S} ?= ${S:T:R}
                    169: .endif
1.65      mycroft   170: SCRIPTSDIR_${S} ?= ${SCRIPTSDIR}
1.74      mycroft   171: scriptsinstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  172: .if !defined(UPDATE)
1.65      mycroft   173: .PHONY: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  174: .endif
1.103     fredb     175: .if !defined(BUILD) && !make(all) && !make(${S})
1.65      mycroft   176: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: .MADE
1.63      christos  177: .endif
                    178:
1.72      mycroft   179: .PRECIOUS: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.65      mycroft   180: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: ${S}
1.102     simonb    181:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
                    182:            -o ${SCRIPTSOWN_${S}} -g ${SCRIPTSGRP_${S}} -m ${SCRIPTSMODE_${S}} \
                    183:            ${.ALLSRC} ${.TARGET}
1.63      christos  184: .endfor
1.14      mycroft   185: .endif
1.1       cgd       186:
1.74      mycroft   187: .if !target(scriptsinstall)
                    188: scriptsinstall::
1.1       cgd       189: .endif
                    190:
1.52      cgd       191: lint: ${LOBJS}
                    192: .if defined(LOBJS) && !empty(LOBJS)
1.90      cgd       193:        ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       194: .endif
                    195:
                    196: .include <bsd.man.mk>
1.50      jtc       197: .include <bsd.nls.mk>
1.66      christos  198: .include <bsd.files.mk>
1.63      christos  199: .include <bsd.inc.mk>
1.83      mycroft   200: .include <bsd.links.mk>
1.26      mycroft   201: .include <bsd.dep.mk>
1.54      christos  202: .include <bsd.sys.mk>
1.88      mycroft   203:
                    204: # Make sure all of the standard targets are defined, even if they do nothing.
                    205: regress:

CVSweb <webmaster@jp.NetBSD.org>