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

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

CVSweb <webmaster@jp.NetBSD.org>