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

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

CVSweb <webmaster@jp.NetBSD.org>