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

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

CVSweb <webmaster@jp.NetBSD.org>