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

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

CVSweb <webmaster@jp.NetBSD.org>