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

1.125   ! christos    1: #      $NetBSD: bsd.prog.mk,v 1.124 2001/01/14 06:17:27 christos 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.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
                     68: LIBPOSIX?=     ${DESTDIR}/usr/lib/libposix.a
                     69: LIBRESOLV?=    ${DESTDIR}/usr/lib/libresolv.a
1.117     thorpej    70: LIBRMT?=       ${DESTDIR}/usr/lib/librmt.a
                     71: LIBROKEN?=     ${DESTDIR}/usr/lib/libroken.a
1.86      cjs        72: LIBRPCSVC?=    ${DESTDIR}/usr/lib/librpcsvc.a
                     73: LIBSKEY?=      ${DESTDIR}/usr/lib/libskey.a
1.117     thorpej    74: LIBSS?=                ${DESTDIR}/usr/lib/libss.a
1.122     mrg        75: LIBSSL?=       ${DESTDIR}/usr/lib/liblss.a
1.117     thorpej    76: LIBSL?=                ${DESTDIR}/usr/lib/libsl.a
1.86      cjs        77: LIBTERMCAP?=   ${DESTDIR}/usr/lib/libtermcap.a
                     78: LIBTELNET?=    ${DESTDIR}/usr/lib/libtelnet.a
1.117     thorpej    79: LIBUSB?=       ${DESTDIR}/usr/lib/libusb.a
1.86      cjs        80: LIBUTIL?=      ${DESTDIR}/usr/lib/libutil.a
                     81: LIBWRAP?=      ${DESTDIR}/usr/lib/libwrap.a
                     82: LIBY?=         ${DESTDIR}/usr/lib/liby.a
                     83: LIBZ?=         ${DESTDIR}/usr/lib/libz.a
1.1       cgd        84:
                     85: .if defined(SHAREDSTRINGS)
                     86: CLEANFILES+=strings
                     87: .c.o:
                     88:        ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
                     89:        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
                     90:        @rm -f x.c
1.18      mycroft    91:
                     92: .cc.o:
                     93:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     94:        @mv -f x.c x.cc
                     95:        @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26      mycroft    96:        @rm -f x.cc
1.18      mycroft    97:
                     98: .C.o:
                     99:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                    100:        @mv -f x.c x.C
                    101:        @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26      mycroft   102:        @rm -f x.C
1.1       cgd       103: .endif
                    104:
1.38      jtc       105:
1.1       cgd       106: .if defined(PROG)
1.80      mycroft   107: SRCS?=         ${PROG}.c
                    108:
1.81      mycroft   109: DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.92      tv        110: CLEANFILES+=   ${DPSRCS}
1.93      tv        111: .if defined(YHEADER)
                    112: CLEANFILES+=   ${SRCS:M*.y:.y=.h}
                    113: .endif
1.80      mycroft   114:
1.108     eeh       115: .if !empty(SRCS:N*.h:N*.sh:N*.fth)
                    116: OBJS+=         ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
1.80      mycroft   117: LOBJS+=                ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd       118: .endif
1.1       cgd       119:
1.47      cgd       120: .if defined(OBJS) && !empty(OBJS)
1.76      gwr       121: .NOPATH: ${OBJS}
1.86      cjs       122: .if defined(DESTDIR)
                    123:
1.80      mycroft   124: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.125   ! christos  125: .if !target(${PROG})
1.118     erh       126:        ${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  127: .endif
1.4       nate      128:
1.46      mycroft   129: .else
1.86      cjs       130:
1.80      mycroft   131: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.125   ! christos  132: .if !target(${PROG})
1.32      cgd       133:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.125   ! christos  134: .endif
1.1       cgd       135:
1.86      cjs       136: .endif # defined(DESTDIR)
1.47      cgd       137: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd       138:
1.100     lukem     139: .if !defined(MAN)
1.49      cgd       140: MAN=   ${PROG}.1
                    141: .endif # !defined(MAN)
                    142: .endif # defined(PROG)
1.11      mycroft   143:
1.107     mycroft   144: realall: ${PROG} ${SCRIPTS}
1.1       cgd       145:
1.60      cgd       146: cleanprog:
1.53      cgd       147:        rm -f a.out [Ee]rrs mklog core *.core \
                    148:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd       149:
1.59      cgd       150: .if defined(SRCS)
                    151: afterdepend: .depend
                    152:        @(TMP=/tmp/_depend$$$$; \
                    153:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                    154:              < .depend > $$TMP; \
                    155:            mv $$TMP .depend)
                    156: .endif
1.27      mycroft   157:
1.74      mycroft   158: .if defined(PROG) && !target(proginstall)
1.114     mycroft   159: PROGNAME?=${PROG}
                    160:
1.63      christos  161: proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
1.114     mycroft   162: .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
1.63      christos  163: .if !defined(UPDATE)
                    164: .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
                    165: .endif
1.114     mycroft   166:
1.115     mycroft   167: __proginstall: .USE
                    168:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
                    169:            -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
                    170:
1.103     fredb     171: .if !defined(BUILD) && !make(all) && !make(${PROG})
1.63      christos  172: ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
                    173: .endif
1.115     mycroft   174: ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
1.23      mycroft   175: .endif
                    176:
1.74      mycroft   177: .if !target(proginstall)
                    178: proginstall::
                    179: .endif
                    180:
                    181: .if defined(SCRIPTS) && !target(scriptsinstall)
1.65      mycroft   182: SCRIPTSDIR?=${BINDIR}
                    183: SCRIPTSOWN?=${BINOWN}
                    184: SCRIPTSGRP?=${BINGRP}
                    185: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   186:
                    187: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   188: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.63      christos  189: .if !defined(UPDATE)
1.113     mycroft   190: .PHONY: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.63      christos  191: .endif
1.113     mycroft   192:
1.115     mycroft   193: __scriptinstall: .USE
                    194:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
1.116     mycroft   195:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    196:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    197:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.115     mycroft   198:            ${.ALLSRC} ${.TARGET}
                    199:
1.113     mycroft   200: .for S in ${SCRIPTS}
1.103     fredb     201: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   202: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  203: .endif
1.115     mycroft   204: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.63      christos  205: .endfor
1.14      mycroft   206: .endif
1.1       cgd       207:
1.74      mycroft   208: .if !target(scriptsinstall)
                    209: scriptsinstall::
1.1       cgd       210: .endif
                    211:
1.52      cgd       212: lint: ${LOBJS}
                    213: .if defined(LOBJS) && !empty(LOBJS)
1.90      cgd       214:        ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       215: .endif
                    216:
                    217: .include <bsd.man.mk>
1.50      jtc       218: .include <bsd.nls.mk>
1.66      christos  219: .include <bsd.files.mk>
1.63      christos  220: .include <bsd.inc.mk>
1.83      mycroft   221: .include <bsd.links.mk>
1.26      mycroft   222: .include <bsd.dep.mk>
1.54      christos  223: .include <bsd.sys.mk>
1.88      mycroft   224:
                    225: # Make sure all of the standard targets are defined, even if they do nothing.
                    226: regress:

CVSweb <webmaster@jp.NetBSD.org>