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

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

CVSweb <webmaster@jp.NetBSD.org>