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

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

CVSweb <webmaster@jp.NetBSD.org>