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

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

CVSweb <webmaster@jp.NetBSD.org>