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

1.120   ! itojun      1: #      $NetBSD: bsd.prog.mk,v 1.119 2000/10/07 20:26:36 deberg 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.120   ! itojun     47: LIBINTL?=      ${DESTDIR}/usr/lib/libintl.a
1.101     itojun     48: LIBIPSEC?=     ${DESTDIR}/usr/lib/libipsec.a
1.117     thorpej    49: LIBKADM?=      ${DESTDIR}/usr/lib/libkadm.a
                     50: LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a
                     51: LIBKADM5SRV?=  ${DESTDIR}/usr/lib/libkadm5srv.a
                     52: LIBKAFS?=      ${DESTDIR}/usr/lib/libkafs.a
1.119     deberg     53: LIBKDB?=       ${DESTDIR}/usr/lib/libkdb.a
1.86      cjs        54: LIBKRB?=       ${DESTDIR}/usr/lib/libkrb.a
1.117     thorpej    55: LIBKRB5?=      ${DESTDIR}/usr/lib/libkrb5.a
                     56: LIBKSTREAM?=   ${DESTDIR}/usr/lib/libkstream.a
1.86      cjs        57: LIBKVM?=       ${DESTDIR}/usr/lib/libkvm.a
                     58: LIBL?=         ${DESTDIR}/usr/lib/libl.a
                     59: LIBM?=         ${DESTDIR}/usr/lib/libm.a
1.105     blymn      60: LIBMENU?=      ${DESTDIR}/usr/lib/libmenu.a
1.89      lukem      61: LIBOBJC?=      ${DESTDIR}/usr/lib/libobjc.a
1.117     thorpej    62: LIBOSSAUDIO?=  ${DESTDIR}/usr/lib/libossaudio.a
1.86      cjs        63: LIBPCAP?=      ${DESTDIR}/usr/lib/libpcap.a
                     64: LIBPOSIX?=     ${DESTDIR}/usr/lib/libposix.a
                     65: LIBRESOLV?=    ${DESTDIR}/usr/lib/libresolv.a
1.117     thorpej    66: LIBRMT?=       ${DESTDIR}/usr/lib/librmt.a
                     67: LIBROKEN?=     ${DESTDIR}/usr/lib/libroken.a
1.86      cjs        68: LIBRPCSVC?=    ${DESTDIR}/usr/lib/librpcsvc.a
                     69: LIBSKEY?=      ${DESTDIR}/usr/lib/libskey.a
1.117     thorpej    70: LIBSS?=                ${DESTDIR}/usr/lib/libss.a
                     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:
                     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.81      mycroft   104: DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.92      tv        105: CLEANFILES+=   ${DPSRCS}
1.93      tv        106: .if defined(YHEADER)
                    107: CLEANFILES+=   ${SRCS:M*.y:.y=.h}
                    108: .endif
1.80      mycroft   109:
1.108     eeh       110: .if !empty(SRCS:N*.h:N*.sh:N*.fth)
                    111: OBJS+=         ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
1.80      mycroft   112: LOBJS+=                ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd       113: .endif
1.1       cgd       114:
1.47      cgd       115: .if defined(OBJS) && !empty(OBJS)
1.76      gwr       116: .NOPATH: ${OBJS}
1.86      cjs       117: .if defined(DESTDIR)
                    118:
1.80      mycroft   119: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
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.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.32      cgd       125:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.1       cgd       126:
1.86      cjs       127: .endif # defined(DESTDIR)
1.47      cgd       128: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd       129:
1.100     lukem     130: .if !defined(MAN)
1.49      cgd       131: MAN=   ${PROG}.1
                    132: .endif # !defined(MAN)
                    133: .endif # defined(PROG)
1.11      mycroft   134:
1.107     mycroft   135: realall: ${PROG} ${SCRIPTS}
1.1       cgd       136:
1.60      cgd       137: cleanprog:
1.53      cgd       138:        rm -f a.out [Ee]rrs mklog core *.core \
                    139:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd       140:
1.59      cgd       141: .if defined(SRCS)
                    142: afterdepend: .depend
                    143:        @(TMP=/tmp/_depend$$$$; \
                    144:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                    145:              < .depend > $$TMP; \
                    146:            mv $$TMP .depend)
                    147: .endif
1.27      mycroft   148:
1.74      mycroft   149: .if defined(PROG) && !target(proginstall)
1.114     mycroft   150: PROGNAME?=${PROG}
                    151:
1.63      christos  152: proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
1.114     mycroft   153: .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
1.63      christos  154: .if !defined(UPDATE)
                    155: .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
                    156: .endif
1.114     mycroft   157:
1.115     mycroft   158: __proginstall: .USE
                    159:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
                    160:            -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
                    161:
1.103     fredb     162: .if !defined(BUILD) && !make(all) && !make(${PROG})
1.63      christos  163: ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
                    164: .endif
1.115     mycroft   165: ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
1.23      mycroft   166: .endif
                    167:
1.74      mycroft   168: .if !target(proginstall)
                    169: proginstall::
                    170: .endif
                    171:
                    172: .if defined(SCRIPTS) && !target(scriptsinstall)
1.65      mycroft   173: SCRIPTSDIR?=${BINDIR}
                    174: SCRIPTSOWN?=${BINOWN}
                    175: SCRIPTSGRP?=${BINGRP}
                    176: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   177:
                    178: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   179: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.63      christos  180: .if !defined(UPDATE)
1.113     mycroft   181: .PHONY: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.63      christos  182: .endif
1.113     mycroft   183:
1.115     mycroft   184: __scriptinstall: .USE
                    185:        ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
1.116     mycroft   186:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    187:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    188:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.115     mycroft   189:            ${.ALLSRC} ${.TARGET}
                    190:
1.113     mycroft   191: .for S in ${SCRIPTS}
1.103     fredb     192: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   193: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  194: .endif
1.115     mycroft   195: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.63      christos  196: .endfor
1.14      mycroft   197: .endif
1.1       cgd       198:
1.74      mycroft   199: .if !target(scriptsinstall)
                    200: scriptsinstall::
1.1       cgd       201: .endif
                    202:
1.52      cgd       203: lint: ${LOBJS}
                    204: .if defined(LOBJS) && !empty(LOBJS)
1.90      cgd       205:        ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       206: .endif
                    207:
                    208: .include <bsd.man.mk>
1.50      jtc       209: .include <bsd.nls.mk>
1.66      christos  210: .include <bsd.files.mk>
1.63      christos  211: .include <bsd.inc.mk>
1.83      mycroft   212: .include <bsd.links.mk>
1.26      mycroft   213: .include <bsd.dep.mk>
1.54      christos  214: .include <bsd.sys.mk>
1.88      mycroft   215:
                    216: # Make sure all of the standard targets are defined, even if they do nothing.
                    217: regress:

CVSweb <webmaster@jp.NetBSD.org>