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

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

CVSweb <webmaster@jp.NetBSD.org>