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

1.67    ! mikel       1: #      $NetBSD: bsd.prog.mk,v 1.66 1997/03/27 17:33:37 christos Exp $
        !             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.67    ! mikel      91: .if !target(all)
1.1       cgd        92: .MAIN: all
1.43      cgd        93: all: ${PROG} _SUBDIRUSE
1.67    ! mikel      94: .endif
1.1       cgd        95:
                     96: .if !target(clean)
1.60      cgd        97: cleanprog:
1.53      cgd        98:        rm -f a.out [Ee]rrs mklog core *.core \
                     99:            ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
1.1       cgd       100:
1.60      cgd       101: clean: _SUBDIRUSE cleanprog
                    102: cleandir: _SUBDIRUSE cleanprog
                    103: .else
1.43      cgd       104: cleandir: _SUBDIRUSE clean
1.60      cgd       105: .endif
1.59      cgd       106:
                    107: .if defined(SRCS)
                    108: afterdepend: .depend
                    109:        @(TMP=/tmp/_depend$$$$; \
                    110:            sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                    111:              < .depend > $$TMP; \
                    112:            mv $$TMP .depend)
                    113: .endif
1.27      mycroft   114:
1.1       cgd       115: .if !target(install)
                    116: .if !target(beforeinstall)
                    117: beforeinstall:
                    118: .endif
                    119: .if !target(afterinstall)
                    120: afterinstall:
                    121: .endif
                    122:
1.14      mycroft   123: .if !target(realinstall)
1.63      christos  124:
1.1       cgd       125: .if defined(PROG)
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:
                    135: ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}
1.56      thorpej   136:        ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1.63      christos  137:            ${.ALLSRC} ${.TARGET}
1.23      mycroft   138: .endif
                    139:
1.63      christos  140: .if defined(SCRIPTS)
1.65      mycroft   141: SCRIPTSDIR?=${BINDIR}
                    142: SCRIPTSOWN?=${BINOWN}
                    143: SCRIPTSGRP?=${BINGRP}
                    144: SCRIPTSMODE?=${BINMODE}
1.63      christos  145: .for S in ${SCRIPTS}
1.65      mycroft   146: SCRIPTSDIR_${S}?=${SCRIPTSDIR}
                    147: SCRIPTSOWN_${S}?=${SCRIPTSOWN}
                    148: SCRIPTSGRP_${S}?=${SCRIPTSGRP}
                    149: SCRIPTSMODE_${S}?=${SCRIPTSMODE}
1.63      christos  150: .if defined(SCRIPTSNAME)
                    151: SCRIPTSNAME_${S} ?= ${SCRIPTSNAME}
                    152: .else
                    153: SCRIPTSNAME_${S} ?= ${S:T:R}
                    154: .endif
1.65      mycroft   155: SCRIPTSDIR_${S} ?= ${SCRIPTSDIR}
                    156: proginstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  157: .if !defined(UPDATE)
1.65      mycroft   158: .PHONY: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
1.63      christos  159: .endif
                    160: .if !defined(BUILD)
1.65      mycroft   161: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: .MADE
1.63      christos  162: .endif
                    163:
1.65      mycroft   164: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: ${S}
                    165:        ${INSTALL} ${COPY} -o ${SCRIPTSOWN_${S}} -g ${SCRIPTSGRP_${S}} \
                    166:                -m ${SCRIPTSMODE_${S}} ${.ALLSRC} ${.TARGET}
1.63      christos  167: .endfor
1.14      mycroft   168: .endif
1.1       cgd       169:
1.63      christos  170: .if target(proginstall)
1.66      christos  171: realinstall: proginstall filesinstall
1.63      christos  172: .else
1.66      christos  173: realinstall: filesinstall
1.63      christos  174: .endif
                    175: .endif
                    176:
                    177: install: ${MANINSTALL} _SUBDIRUSE linksinstall
                    178:
                    179: ${MANINSTALL}: afterinstall
1.1       cgd       180: afterinstall: realinstall
                    181: realinstall: beforeinstall
                    182: .endif
                    183:
                    184: .if !target(lint)
1.52      cgd       185: lint: ${LOBJS}
                    186: .if defined(LOBJS) && !empty(LOBJS)
                    187:        @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       188: .endif
                    189: .endif
                    190:
                    191: .if !defined(NOMAN)
                    192: .include <bsd.man.mk>
1.50      jtc       193: .endif
                    194:
                    195: .if !defined(NONLS)
                    196: .include <bsd.nls.mk>
1.1       cgd       197: .endif
1.24      mycroft   198:
                    199: .include <bsd.obj.mk>
1.63      christos  200: .include <bsd.links.mk>
1.66      christos  201: .include <bsd.files.mk>
1.63      christos  202: .include <bsd.inc.mk>
1.26      mycroft   203: .include <bsd.dep.mk>
1.28      mycroft   204: .include <bsd.subdir.mk>
1.54      christos  205: .include <bsd.sys.mk>

CVSweb <webmaster@jp.NetBSD.org>