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

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

CVSweb <webmaster@jp.NetBSD.org>