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

1.91    ! tv          1: #      $NetBSD: bsd.prog.mk,v 1.90 1997/11/03 22:51:28 cgd 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.75      mycroft    16: clean cleandir:        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
                     21: .if (${MACHINE_ARCH} == "alpha")   || \
                     22:     (${MACHINE_ARCH} == "powerpc")
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.87      gwr        31: LIBBFD?=       ${DESTDIR}/usr/lib/libbfd.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.91    ! tv         89: CLEANFILES+=   ${DPSRCS} ${SRCS:M*.y:.y=.h}
1.80      mycroft    90:
1.45      cgd        91: .if !empty(SRCS:N*.h:N*.sh)
1.80      mycroft    92: OBJS+=         ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
                     93: LOBJS+=                ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd        94: .endif
1.1       cgd        95:
1.47      cgd        96: .if defined(OBJS) && !empty(OBJS)
1.76      gwr        97: .NOPATH: ${OBJS}
1.86      cjs        98: .if defined(DESTDIR)
                     99:
1.80      mycroft   100: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.86      cjs       101:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND}
1.4       nate      102:
1.46      mycroft   103: .else
1.86      cjs       104:
1.80      mycroft   105: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.32      cgd       106:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.1       cgd       107:
1.86      cjs       108: .endif # defined(DESTDIR)
1.47      cgd       109: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd       110:
1.49      cgd       111: .if    !defined(MAN)
                    112: MAN=   ${PROG}.1
                    113: .endif # !defined(MAN)
                    114: .endif # defined(PROG)
1.11      mycroft   115:
1.80      mycroft   116: all: ${PROG}
1.1       cgd       117:
1.60      cgd       118: cleanprog:
1.53      cgd       119:        rm -f a.out [Ee]rrs mklog core *.core \
                    120:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd       121:
1.59      cgd       122: .if defined(SRCS)
                    123: afterdepend: .depend
                    124:        @(TMP=/tmp/_depend$$$$; \
                    125:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                    126:              < .depend > $$TMP; \
                    127:            mv $$TMP .depend)
                    128: .endif
1.27      mycroft   129:
1.74      mycroft   130: .if defined(PROG) && !target(proginstall)
1.63      christos  131: PROGNAME?= ${PROG}
                    132: proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
                    133: .if !defined(UPDATE)
                    134: .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
                    135: .endif
                    136: .if !defined(BUILD)
                    137: ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
                    138: .endif
                    139:
1.72      mycroft   140: .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
1.63      christos  141: ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}
1.69      thorpej   142:        ${INSTALL} ${COPY} ${STRIPFLAG} -o ${BINOWN} -g ${BINGRP} \
                    143:            -m ${BINMODE} ${.ALLSRC} ${.TARGET}
1.23      mycroft   144: .endif
                    145:
1.74      mycroft   146: .if !target(proginstall)
                    147: proginstall::
                    148: .endif
                    149:
                    150: .if defined(SCRIPTS) && !target(scriptsinstall)
1.65      mycroft   151: SCRIPTSDIR?=${BINDIR}
                    152: SCRIPTSOWN?=${BINOWN}
                    153: SCRIPTSGRP?=${BINGRP}
                    154: SCRIPTSMODE?=${BINMODE}
1.63      christos  155: .for S in ${SCRIPTS}
1.65      mycroft   156: SCRIPTSDIR_${S}?=${SCRIPTSDIR}
                    157: SCRIPTSOWN_${S}?=${SCRIPTSOWN}
                    158: SCRIPTSGRP_${S}?=${SCRIPTSGRP}
                    159: SCRIPTSMODE_${S}?=${SCRIPTSMODE}
1.63      christos  160: .if defined(SCRIPTSNAME)
                    161: SCRIPTSNAME_${S} ?= ${SCRIPTSNAME}
                    162: .else
                    163: SCRIPTSNAME_${S} ?= ${S:T:R}
                    164: .endif
1.65      mycroft   165: SCRIPTSDIR_${S} ?= ${SCRIPTSDIR}
1.74      mycroft   166: scriptsinstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  167: .if !defined(UPDATE)
1.65      mycroft   168: .PHONY: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  169: .endif
                    170: .if !defined(BUILD)
1.65      mycroft   171: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: .MADE
1.63      christos  172: .endif
                    173:
1.72      mycroft   174: .PRECIOUS: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.65      mycroft   175: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: ${S}
                    176:        ${INSTALL} ${COPY} -o ${SCRIPTSOWN_${S}} -g ${SCRIPTSGRP_${S}} \
                    177:                -m ${SCRIPTSMODE_${S}} ${.ALLSRC} ${.TARGET}
1.63      christos  178: .endfor
1.14      mycroft   179: .endif
1.1       cgd       180:
1.74      mycroft   181: .if !target(scriptsinstall)
                    182: scriptsinstall::
1.1       cgd       183: .endif
                    184:
1.52      cgd       185: lint: ${LOBJS}
                    186: .if defined(LOBJS) && !empty(LOBJS)
1.90      cgd       187:        ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       188: .endif
                    189:
                    190: .include <bsd.man.mk>
1.50      jtc       191: .include <bsd.nls.mk>
1.66      christos  192: .include <bsd.files.mk>
1.63      christos  193: .include <bsd.inc.mk>
1.83      mycroft   194: .include <bsd.links.mk>
1.26      mycroft   195: .include <bsd.dep.mk>
1.54      christos  196: .include <bsd.sys.mk>
1.88      mycroft   197:
                    198: # Make sure all of the standard targets are defined, even if they do nothing.
                    199: regress:

CVSweb <webmaster@jp.NetBSD.org>