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

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

CVSweb <webmaster@jp.NetBSD.org>