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

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

CVSweb <webmaster@jp.NetBSD.org>