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

1.133   ! thorpej     1: #      $NetBSD: bsd.prog.mk,v 1.132 2001/08/14 07:02:13 tv 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.132     tv         17: clean:         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
1.121     garbled    35: LIBCDK?=       ${DESTDIR}/usr/lib/libcdk.a
1.117     thorpej    36: LIBCOM_ERR?=   ${DESTDIR}/usr/lib/libcom_err.a
1.86      cjs        37: LIBCOMPAT?=    ${DESTDIR}/usr/lib/libcompat.a
                     38: LIBCRYPT?=     ${DESTDIR}/usr/lib/libcrypt.a
1.117     thorpej    39: LIBCRYPTO?=    ${DESTDIR}/usr/lib/libcrypto.a
1.123     mrg        40: LIBCRYPTO_RC5?=        ${DESTDIR}/usr/lib/libcrypto_rc5.a
                     41: LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1.86      cjs        42: LIBCURSES?=    ${DESTDIR}/usr/lib/libcurses.a
                     43: LIBDBM?=       ${DESTDIR}/usr/lib/libdbm.a
                     44: LIBDES?=       ${DESTDIR}/usr/lib/libdes.a
                     45: LIBEDIT?=      ${DESTDIR}/usr/lib/libedit.a
1.121     garbled    46: LIBFORM?=      ${DESTDIR}/usr/lib/libform.a
1.86      cjs        47: LIBGCC?=       ${DESTDIR}/usr/lib/libgcc.a
                     48: LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1.117     thorpej    49: LIBGSSAPI?=    ${DESTDIR}/usr/lib/libgssapi.a
1.119     deberg     50: LIBHDB?=       ${DESTDIR}/usr/lib/libhdb.a
1.120     itojun     51: LIBINTL?=      ${DESTDIR}/usr/lib/libintl.a
1.101     itojun     52: LIBIPSEC?=     ${DESTDIR}/usr/lib/libipsec.a
1.117     thorpej    53: LIBKADM?=      ${DESTDIR}/usr/lib/libkadm.a
                     54: LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a
                     55: LIBKADM5SRV?=  ${DESTDIR}/usr/lib/libkadm5srv.a
                     56: LIBKAFS?=      ${DESTDIR}/usr/lib/libkafs.a
1.119     deberg     57: LIBKDB?=       ${DESTDIR}/usr/lib/libkdb.a
1.86      cjs        58: LIBKRB?=       ${DESTDIR}/usr/lib/libkrb.a
1.117     thorpej    59: LIBKRB5?=      ${DESTDIR}/usr/lib/libkrb5.a
                     60: LIBKSTREAM?=   ${DESTDIR}/usr/lib/libkstream.a
1.86      cjs        61: LIBKVM?=       ${DESTDIR}/usr/lib/libkvm.a
                     62: LIBL?=         ${DESTDIR}/usr/lib/libl.a
                     63: LIBM?=         ${DESTDIR}/usr/lib/libm.a
1.105     blymn      64: LIBMENU?=      ${DESTDIR}/usr/lib/libmenu.a
1.89      lukem      65: LIBOBJC?=      ${DESTDIR}/usr/lib/libobjc.a
1.117     thorpej    66: LIBOSSAUDIO?=  ${DESTDIR}/usr/lib/libossaudio.a
1.86      cjs        67: LIBPCAP?=      ${DESTDIR}/usr/lib/libpcap.a
1.133   ! thorpej    68: LIBPCI?=       ${DESTDIR}/usr/lib/libpci.a
1.86      cjs        69: LIBPOSIX?=     ${DESTDIR}/usr/lib/libposix.a
                     70: LIBRESOLV?=    ${DESTDIR}/usr/lib/libresolv.a
1.117     thorpej    71: LIBRMT?=       ${DESTDIR}/usr/lib/librmt.a
                     72: LIBROKEN?=     ${DESTDIR}/usr/lib/libroken.a
1.86      cjs        73: LIBRPCSVC?=    ${DESTDIR}/usr/lib/librpcsvc.a
                     74: LIBSKEY?=      ${DESTDIR}/usr/lib/libskey.a
1.117     thorpej    75: LIBSS?=                ${DESTDIR}/usr/lib/libss.a
1.128     itojun     76: LIBSSL?=       ${DESTDIR}/usr/lib/libssl.a
1.117     thorpej    77: LIBSL?=                ${DESTDIR}/usr/lib/libsl.a
1.86      cjs        78: LIBTERMCAP?=   ${DESTDIR}/usr/lib/libtermcap.a
                     79: LIBTELNET?=    ${DESTDIR}/usr/lib/libtelnet.a
1.117     thorpej    80: LIBUSB?=       ${DESTDIR}/usr/lib/libusb.a
1.86      cjs        81: LIBUTIL?=      ${DESTDIR}/usr/lib/libutil.a
                     82: LIBWRAP?=      ${DESTDIR}/usr/lib/libwrap.a
                     83: LIBY?=         ${DESTDIR}/usr/lib/liby.a
                     84: LIBZ?=         ${DESTDIR}/usr/lib/libz.a
1.1       cgd        85:
                     86: .if defined(SHAREDSTRINGS)
                     87: CLEANFILES+=strings
                     88: .c.o:
                     89:        ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
                     90:        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
                     91:        @rm -f x.c
1.18      mycroft    92:
                     93: .cc.o:
                     94:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     95:        @mv -f x.c x.cc
                     96:        @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26      mycroft    97:        @rm -f x.cc
1.18      mycroft    98:
                     99: .C.o:
                    100:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                    101:        @mv -f x.c x.C
                    102:        @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26      mycroft   103:        @rm -f x.C
1.1       cgd       104: .endif
                    105:
1.38      jtc       106:
1.1       cgd       107: .if defined(PROG)
1.80      mycroft   108: SRCS?=         ${PROG}.c
                    109:
1.81      mycroft   110: DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.92      tv        111: CLEANFILES+=   ${DPSRCS}
1.93      tv        112: .if defined(YHEADER)
                    113: CLEANFILES+=   ${SRCS:M*.y:.y=.h}
                    114: .endif
1.80      mycroft   115:
1.108     eeh       116: .if !empty(SRCS:N*.h:N*.sh:N*.fth)
                    117: OBJS+=         ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
1.80      mycroft   118: LOBJS+=                ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd       119: .endif
1.1       cgd       120:
1.47      cgd       121: .if defined(OBJS) && !empty(OBJS)
1.76      gwr       122: .NOPATH: ${OBJS}
1.86      cjs       123: .if defined(DESTDIR)
                    124:
1.80      mycroft   125: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.127     christos  126: .if !commands(${PROG})
1.118     erh       127:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -Wl,-rpath-link,${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -L${DESTDIR}/usr/lib -lgcc -lc -lgcc ${LIBCRTEND}
1.125     christos  128: .endif
1.4       nate      129:
1.46      mycroft   130: .else
1.86      cjs       131:
1.80      mycroft   132: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.127     christos  133: .if !commands(${PROG})
1.32      cgd       134:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.125     christos  135: .endif
1.1       cgd       136:
1.86      cjs       137: .endif # defined(DESTDIR)
1.47      cgd       138: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd       139:
1.100     lukem     140: .if !defined(MAN)
1.49      cgd       141: MAN=   ${PROG}.1
                    142: .endif # !defined(MAN)
                    143: .endif # defined(PROG)
1.11      mycroft   144:
1.107     mycroft   145: realall: ${PROG} ${SCRIPTS}
1.1       cgd       146:
1.60      cgd       147: cleanprog:
1.53      cgd       148:        rm -f a.out [Ee]rrs mklog core *.core \
                    149:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd       150:
1.129     jmc       151: .if defined(SRCS) && !target(afterdepend)
1.59      cgd       152: afterdepend: .depend
                    153:        @(TMP=/tmp/_depend$$$$; \
                    154:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                    155:              < .depend > $$TMP; \
                    156:            mv $$TMP .depend)
                    157: .endif
1.27      mycroft   158:
1.74      mycroft   159: .if defined(PROG) && !target(proginstall)
1.114     mycroft   160: PROGNAME?=${PROG}
                    161:
1.63      christos  162: proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
1.114     mycroft   163: .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
1.63      christos  164: .if !defined(UPDATE)
                    165: .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
                    166: .endif
1.114     mycroft   167:
1.115     mycroft   168: __proginstall: .USE
                    169:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
                    170:            -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
                    171:
1.103     fredb     172: .if !defined(BUILD) && !make(all) && !make(${PROG})
1.63      christos  173: ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
                    174: .endif
1.115     mycroft   175: ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
1.23      mycroft   176: .endif
                    177:
1.74      mycroft   178: .if !target(proginstall)
                    179: proginstall::
                    180: .endif
                    181:
                    182: .if defined(SCRIPTS) && !target(scriptsinstall)
1.65      mycroft   183: SCRIPTSDIR?=${BINDIR}
                    184: SCRIPTSOWN?=${BINOWN}
                    185: SCRIPTSGRP?=${BINGRP}
                    186: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   187:
                    188: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   189: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.63      christos  190: .if !defined(UPDATE)
1.113     mycroft   191: .PHONY: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.63      christos  192: .endif
1.113     mycroft   193:
1.115     mycroft   194: __scriptinstall: .USE
                    195:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
1.116     mycroft   196:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    197:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    198:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.115     mycroft   199:            ${.ALLSRC} ${.TARGET}
                    200:
1.130     sommerfe  201: .for S in ${SCRIPTS:O:u}
1.103     fredb     202: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   203: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  204: .endif
1.115     mycroft   205: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.63      christos  206: .endfor
1.14      mycroft   207: .endif
1.1       cgd       208:
1.74      mycroft   209: .if !target(scriptsinstall)
                    210: scriptsinstall::
1.1       cgd       211: .endif
                    212:
1.52      cgd       213: lint: ${LOBJS}
                    214: .if defined(LOBJS) && !empty(LOBJS)
1.90      cgd       215:        ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       216: .endif
                    217:
                    218: .include <bsd.man.mk>
1.50      jtc       219: .include <bsd.nls.mk>
1.66      christos  220: .include <bsd.files.mk>
1.63      christos  221: .include <bsd.inc.mk>
1.83      mycroft   222: .include <bsd.links.mk>
1.26      mycroft   223: .include <bsd.dep.mk>
1.54      christos  224: .include <bsd.sys.mk>
1.88      mycroft   225:
                    226: # Make sure all of the standard targets are defined, even if they do nothing.
                    227: regress:

CVSweb <webmaster@jp.NetBSD.org>