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

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