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

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

CVSweb <webmaster@jp.NetBSD.org>