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

1.84    ! kleink      1: #      $NetBSD: bsd.prog.mk,v 1.83 1997/05/17 16:43:33 mycroft Exp $
1.67      mikel       2: #      @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
1.1       cgd         3:
                      4: .if exists(${.CURDIR}/../Makefile.inc)
                      5: .include "${.CURDIR}/../Makefile.inc"
                      6: .endif
1.48      mycroft     7:
1.74      mycroft     8: .include <bsd.own.mk>
                      9:
1.71      mycroft    10: .MAIN:         all
1.74      mycroft    11: .PHONY:                cleanprog proginstall scriptsinstall
1.80      mycroft    12: realinstall:   proginstall scriptsinstall
1.75      mycroft    13: clean cleandir:        cleanprog
1.1       cgd        14:
1.25      mycroft    15: CFLAGS+=       ${COPTS}
1.1       cgd        16:
1.69      thorpej    17: # ELF platforms depend on crtbegin.o and crtend.o
                     18: .if (${MACHINE_ARCH} == "alpha")   || \
                     19:     (${MACHINE_ARCH} == "powerpc")
                     20: LIBCRTBEGIN?=  ${DESTDIR}/usr/lib/crtbegin.o
                     21: LIBCRTEND?=    ${DESTDIR}/usr/lib/crtend.o
                     22: .else
                     23: LIBCRTBEGIN?=
                     24: LIBCRTEND?=
                     25: .endif
                     26:
1.46      mycroft    27: LIBCRT0?=      ${DESTDIR}/usr/lib/crt0.o
                     28: LIBC?=         ${DESTDIR}/usr/lib/libc.a
1.63      christos   29: LIBC_PIC?=     ${DESTDIR}/usr/lib/libc_pic.a
1.46      mycroft    30: LIBCOMPAT?=    ${DESTDIR}/usr/lib/libcompat.a
                     31: LIBCRYPT?=     ${DESTDIR}/usr/lib/libcrypt.a
                     32: LIBCURSES?=    ${DESTDIR}/usr/lib/libcurses.a
                     33: LIBDBM?=       ${DESTDIR}/usr/lib/libdbm.a
                     34: LIBDES?=       ${DESTDIR}/usr/lib/libdes.a
1.51      mycroft    35: LIBEDIT?=      ${DESTDIR}/usr/lib/libedit.a
1.46      mycroft    36: LIBGCC?=       ${DESTDIR}/usr/lib/libgcc.a
1.63      christos   37: LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1.46      mycroft    38: LIBKDB?=       ${DESTDIR}/usr/lib/libkdb.a
                     39: LIBKRB?=       ${DESTDIR}/usr/lib/libkrb.a
                     40: LIBKVM?=       ${DESTDIR}/usr/lib/libkvm.a
1.55      jtc        41: LIBL?=         ${DESTDIR}/usr/lib/libl.a
1.46      mycroft    42: LIBM?=         ${DESTDIR}/usr/lib/libm.a
                     43: LIBMP?=                ${DESTDIR}/usr/lib/libmp.a
1.70      christos   44: LIBNTP?=       ${DESTDIR}/usr/lib/libntp.a
1.46      mycroft    45: LIBPC?=                ${DESTDIR}/usr/lib/libpc.a
1.58      mikel      46: LIBPCAP?=      ${DESTDIR}/usr/lib/libpcap.a
1.46      mycroft    47: LIBPLOT?=      ${DESTDIR}/usr/lib/libplot.a
1.84    ! kleink     48: LIBPOSIX?=     ${DESTDIR}/usr/lib/libposix.a
1.46      mycroft    49: LIBRESOLV?=    ${DESTDIR}/usr/lib/libresolv.a
                     50: LIBRPCSVC?=    ${DESTDIR}/usr/lib/librpcsvc.a
                     51: LIBSKEY?=      ${DESTDIR}/usr/lib/libskey.a
                     52: LIBTERMCAP?=   ${DESTDIR}/usr/lib/libtermcap.a
1.63      christos   53: LIBTELNET?=    ${DESTDIR}/usr/lib/libtelnet.a
1.46      mycroft    54: LIBUTIL?=      ${DESTDIR}/usr/lib/libutil.a
1.57      mrg        55: LIBWRAP?=      ${DESTDIR}/usr/lib/libwrap.a
1.55      jtc        56: LIBY?=         ${DESTDIR}/usr/lib/liby.a
1.57      mrg        57: LIBZ?=         ${DESTDIR}/usr/lib/libz.a
1.1       cgd        58:
                     59: .if defined(SHAREDSTRINGS)
                     60: CLEANFILES+=strings
                     61: .c.o:
                     62:        ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
                     63:        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
                     64:        @rm -f x.c
1.18      mycroft    65:
                     66: .cc.o:
                     67:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     68:        @mv -f x.c x.cc
                     69:        @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26      mycroft    70:        @rm -f x.cc
1.18      mycroft    71:
                     72: .C.o:
                     73:        ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     74:        @mv -f x.c x.C
                     75:        @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26      mycroft    76:        @rm -f x.C
1.1       cgd        77: .endif
                     78:
1.38      jtc        79:
1.1       cgd        80: .if defined(PROG)
1.80      mycroft    81: SRCS?=         ${PROG}.c
                     82:
1.81      mycroft    83: DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.80      mycroft    84: CLEANFILES+=   ${DPSRCS}
                     85:
1.45      cgd        86: .if !empty(SRCS:N*.h:N*.sh)
1.80      mycroft    87: OBJS+=         ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
                     88: LOBJS+=                ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.45      cgd        89: .endif
1.1       cgd        90:
1.47      cgd        91: .if defined(OBJS) && !empty(OBJS)
1.76      gwr        92: .NOPATH: ${OBJS}
1.46      mycroft    93: .if defined(DESTDIR)
1.4       nate       94:
1.80      mycroft    95: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.69      thorpej    96:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND}
1.4       nate       97:
1.46      mycroft    98: .else
1.4       nate       99:
1.80      mycroft   100: ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
1.32      cgd       101:        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.1       cgd       102:
1.47      cgd       103: .endif # defined(DESTDIR)
                    104: .endif # defined(OBJS) && !empty(OBJS)
1.1       cgd       105:
1.49      cgd       106: .if    !defined(MAN)
                    107: MAN=   ${PROG}.1
                    108: .endif # !defined(MAN)
                    109: .endif # defined(PROG)
1.11      mycroft   110:
1.80      mycroft   111: all: ${PROG}
1.1       cgd       112:
1.60      cgd       113: cleanprog:
1.53      cgd       114:        rm -f a.out [Ee]rrs mklog core *.core \
                    115:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd       116:
1.59      cgd       117: .if defined(SRCS)
                    118: afterdepend: .depend
                    119:        @(TMP=/tmp/_depend$$$$; \
                    120:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                    121:              < .depend > $$TMP; \
                    122:            mv $$TMP .depend)
                    123: .endif
1.27      mycroft   124:
1.74      mycroft   125: .if defined(PROG) && !target(proginstall)
1.63      christos  126: PROGNAME?= ${PROG}
                    127: proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
                    128: .if !defined(UPDATE)
                    129: .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
                    130: .endif
                    131: .if !defined(BUILD)
                    132: ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
                    133: .endif
                    134:
1.72      mycroft   135: .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
1.63      christos  136: ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}
1.69      thorpej   137:        ${INSTALL} ${COPY} ${STRIPFLAG} -o ${BINOWN} -g ${BINGRP} \
                    138:            -m ${BINMODE} ${.ALLSRC} ${.TARGET}
1.23      mycroft   139: .endif
                    140:
1.74      mycroft   141: .if !target(proginstall)
                    142: proginstall::
                    143: .endif
                    144:
                    145: .if defined(SCRIPTS) && !target(scriptsinstall)
1.65      mycroft   146: SCRIPTSDIR?=${BINDIR}
                    147: SCRIPTSOWN?=${BINOWN}
                    148: SCRIPTSGRP?=${BINGRP}
                    149: SCRIPTSMODE?=${BINMODE}
1.63      christos  150: .for S in ${SCRIPTS}
1.65      mycroft   151: SCRIPTSDIR_${S}?=${SCRIPTSDIR}
                    152: SCRIPTSOWN_${S}?=${SCRIPTSOWN}
                    153: SCRIPTSGRP_${S}?=${SCRIPTSGRP}
                    154: SCRIPTSMODE_${S}?=${SCRIPTSMODE}
1.63      christos  155: .if defined(SCRIPTSNAME)
                    156: SCRIPTSNAME_${S} ?= ${SCRIPTSNAME}
                    157: .else
                    158: SCRIPTSNAME_${S} ?= ${S:T:R}
                    159: .endif
1.65      mycroft   160: SCRIPTSDIR_${S} ?= ${SCRIPTSDIR}
1.74      mycroft   161: scriptsinstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  162: .if !defined(UPDATE)
1.65      mycroft   163: .PHONY: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  164: .endif
                    165: .if !defined(BUILD)
1.65      mycroft   166: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: .MADE
1.63      christos  167: .endif
                    168:
1.72      mycroft   169: .PRECIOUS: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.65      mycroft   170: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: ${S}
                    171:        ${INSTALL} ${COPY} -o ${SCRIPTSOWN_${S}} -g ${SCRIPTSGRP_${S}} \
                    172:                -m ${SCRIPTSMODE_${S}} ${.ALLSRC} ${.TARGET}
1.63      christos  173: .endfor
1.14      mycroft   174: .endif
1.1       cgd       175:
1.74      mycroft   176: .if !target(scriptsinstall)
                    177: scriptsinstall::
1.1       cgd       178: .endif
                    179:
1.52      cgd       180: lint: ${LOBJS}
                    181: .if defined(LOBJS) && !empty(LOBJS)
                    182:        @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       183: .endif
                    184:
                    185: .if !defined(NOMAN)
                    186: .include <bsd.man.mk>
1.50      jtc       187: .endif
                    188:
                    189: .if !defined(NONLS)
                    190: .include <bsd.nls.mk>
1.1       cgd       191: .endif
1.24      mycroft   192:
                    193: .include <bsd.obj.mk>
1.66      christos  194: .include <bsd.files.mk>
1.63      christos  195: .include <bsd.inc.mk>
1.83      mycroft   196: .include <bsd.links.mk>
1.26      mycroft   197: .include <bsd.dep.mk>
1.28      mycroft   198: .include <bsd.subdir.mk>
1.54      christos  199: .include <bsd.sys.mk>

CVSweb <webmaster@jp.NetBSD.org>