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

1.64    ! mycroft     1: #      $NetBSD: bsd.prog.mk,v 1.63 1997/03/24 21:54:20 christos Exp $
1.44      cgd         2: #      @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
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(FILES)
                    139: FILESDIR?=${BINDIR}
                    140: FILESOWN?=${BINOWN}
                    141: FILESGRP?=${BINGRP}
                    142: FILESMODE?=${NONBINMODE}
                    143: .for F in ${FILES}
                    144: FILESDIR_${F}?=${FILESDIR}
                    145: FILESOWN_${F}?=${FILESOWN}
                    146: FILESGRP_${F}?=${FILESGRP}
                    147: FILESMODE_${F}?=${FILESMODE}
                    148: .if defined(FILESNAME)
                    149: FILESNAME_${F} ?= ${FILESNAME}
                    150: .else
                    151: FILESNAME_${F} ?= ${F:T}
                    152: .endif
                    153: FILESDIR_${F} ?= ${FILESDIR}
                    154: proginstall:: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}
                    155: .if !defined(UPDATE)
                    156: .PHONY: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}
                    157: .endif
                    158: .if !defined(BUILD)
                    159: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}: .MADE
                    160: .endif
                    161:
                    162: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}: ${F}
                    163:        ${INSTALL} ${COPY} -o ${FILESOWN_${F}} -g ${FILESGRP_${F}} \
                    164:                -m ${FILESMODE_${F}} ${.ALLSRC} ${.TARGET}
                    165: .endfor
                    166: .endif
                    167:
                    168: .if defined(SCRIPTS)
                    169: .for S in ${SCRIPTS}
                    170: .if defined(SCRIPTSNAME)
                    171: SCRIPTSNAME_${S} ?= ${SCRIPTSNAME}
                    172: .else
                    173: SCRIPTSNAME_${S} ?= ${S:T:R}
                    174: .endif
                    175: proginstall:: ${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}
                    176: .if !defined(UPDATE)
                    177: .PHONY: ${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}
                    178: .endif
                    179: .if !defined(BUILD)
                    180: ${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}: .MADE
                    181: .endif
                    182:
                    183: ${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}: ${S}
                    184:        ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    185:            ${.ALLSRC} ${.TARGET}
                    186: .endfor
1.14      mycroft   187: .endif
1.1       cgd       188:
1.63      christos  189: .if target(proginstall)
                    190: realinstall: proginstall
                    191: .else
                    192: realinstall:
                    193: .endif
                    194: .endif
                    195:
                    196: install: ${MANINSTALL} _SUBDIRUSE linksinstall
                    197:
                    198: ${MANINSTALL}: afterinstall
1.1       cgd       199: afterinstall: realinstall
                    200: realinstall: beforeinstall
                    201: .endif
                    202:
                    203: .if !target(lint)
1.52      cgd       204: lint: ${LOBJS}
                    205: .if defined(LOBJS) && !empty(LOBJS)
                    206:        @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
1.1       cgd       207: .endif
                    208: .endif
                    209:
                    210: .if !defined(NOMAN)
                    211: .include <bsd.man.mk>
1.50      jtc       212: .endif
                    213:
                    214: .if !defined(NONLS)
                    215: .include <bsd.nls.mk>
1.1       cgd       216: .endif
1.24      mycroft   217:
                    218: .include <bsd.obj.mk>
1.63      christos  219: .include <bsd.links.mk>
                    220: .include <bsd.inc.mk>
1.26      mycroft   221: .include <bsd.dep.mk>
1.28      mycroft   222: .include <bsd.subdir.mk>
1.54      christos  223: .include <bsd.sys.mk>

CVSweb <webmaster@jp.NetBSD.org>