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

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

CVSweb <webmaster@jp.NetBSD.org>