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

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

CVSweb <webmaster@jp.NetBSD.org>