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

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

CVSweb <webmaster@jp.NetBSD.org>