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

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

CVSweb <webmaster@jp.NetBSD.org>