Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/share/mk/bsd.prog.mk,v rcsdiff: /ftp/cvs/cvsroot/src/share/mk/bsd.prog.mk,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.73 retrieving revision 1.85.2.1 diff -u -p -r1.73 -r1.85.2.1 --- src/share/mk/bsd.prog.mk 1997/05/07 08:42:21 1.73 +++ src/share/mk/bsd.prog.mk 1997/10/12 22:04:54 1.85.2.1 @@ -1,59 +1,64 @@ -# $NetBSD: bsd.prog.mk,v 1.73 1997/05/07 08:42:21 mycroft Exp $ +# $NetBSD: bsd.prog.mk,v 1.85.2.1 1997/10/12 22:04:54 cjs Exp $ # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 +.if !target(__initialized__) +__initialized__: .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif - -.MAIN: all -.PHONY: cleanprog proginstall - .include +.include +.MAIN: all +.endif -.SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 +.PHONY: cleanprog proginstall scriptsinstall +realinstall: proginstall scriptsinstall +clean cleandir: cleanprog CFLAGS+= ${COPTS} # ELF platforms depend on crtbegin.o and crtend.o .if (${MACHINE_ARCH} == "alpha") || \ (${MACHINE_ARCH} == "powerpc") -LIBCRTBEGIN?= ${DESTDIR}/usr/lib/crtbegin.o -LIBCRTEND?= ${DESTDIR}/usr/lib/crtend.o +LIBCRTBEGIN?= ${BUILDDIR}/usr/lib/crtbegin.o +LIBCRTEND?= ${BUILDDIR}/usr/lib/crtend.o .else LIBCRTBEGIN?= LIBCRTEND?= .endif -LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o -LIBC?= ${DESTDIR}/usr/lib/libc.a -LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a -LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a -LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a -LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a -LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a -LIBDES?= ${DESTDIR}/usr/lib/libdes.a -LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a -LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a -LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a -LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a -LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a -LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a -LIBL?= ${DESTDIR}/usr/lib/libl.a -LIBM?= ${DESTDIR}/usr/lib/libm.a -LIBMP?= ${DESTDIR}/usr/lib/libmp.a -LIBNTP?= ${DESTDIR}/usr/lib/libntp.a -LIBPC?= ${DESTDIR}/usr/lib/libpc.a -LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a -LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a -LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a -LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a -LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a -LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a -LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a -LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a -LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a -LIBY?= ${DESTDIR}/usr/lib/liby.a -LIBZ?= ${DESTDIR}/usr/lib/libz.a +LIBCRT0?= ${BUILDDIR}/usr/lib/crt0.o +LIBC?= ${BUILDDIR}/usr/lib/libc.a +LIBC_PIC?= ${BUILDDIR}/usr/lib/libc_pic.a +LIBCOMPAT?= ${BUILDDIR}/usr/lib/libcompat.a +LIBCRYPT?= ${BUILDDIR}/usr/lib/libcrypt.a +LIBCURSES?= ${BUILDDIR}/usr/lib/libcurses.a +LIBDBM?= ${BUILDDIR}/usr/lib/libdbm.a +LIBDES?= ${BUILDDIR}/usr/lib/libdes.a +LIBEDIT?= ${BUILDDIR}/usr/lib/libedit.a +LIBBFD?= ${BUILDDIR}/usr/lib/libbfd.a +LIBGCC?= ${BUILDDIR}/usr/lib/libgcc.a +LIBGNUMALLOC?= ${BUILDDIR}/usr/lib/libgnumalloc.a +LIBKDB?= ${BUILDDIR}/usr/lib/libkdb.a +LIBKRB?= ${BUILDDIR}/usr/lib/libkrb.a +LIBKVM?= ${BUILDDIR}/usr/lib/libkvm.a +LIBL?= ${BUILDDIR}/usr/lib/libl.a +LIBM?= ${BUILDDIR}/usr/lib/libm.a +LIBMP?= ${BUILDDIR}/usr/lib/libmp.a +LIBNTP?= ${BUILDDIR}/usr/lib/libntp.a +LIBPC?= ${BUILDDIR}/usr/lib/libpc.a +LIBPCAP?= ${BUILDDIR}/usr/lib/libpcap.a +LIBPLOT?= ${BUILDDIR}/usr/lib/libplot.a +LIBPOSIX?= ${BUILDDIR}/usr/lib/libposix.a +LIBRESOLV?= ${BUILDDIR}/usr/lib/libresolv.a +LIBRPCSVC?= ${BUILDDIR}/usr/lib/librpcsvc.a +LIBSKEY?= ${BUILDDIR}/usr/lib/libskey.a +LIBTERMCAP?= ${BUILDDIR}/usr/lib/libtermcap.a +LIBTELNET?= ${BUILDDIR}/usr/lib/libtelnet.a +LIBUTIL?= ${BUILDDIR}/usr/lib/libutil.a +LIBWRAP?= ${BUILDDIR}/usr/lib/libwrap.a +LIBY?= ${BUILDDIR}/usr/lib/liby.a +LIBZ?= ${BUILDDIR}/usr/lib/libz.a .if defined(SHAREDSTRINGS) CLEANFILES+=strings @@ -77,24 +82,29 @@ CLEANFILES+=strings .if defined(PROG) -SRCS?= ${PROG}.c +SRCS?= ${PROG}.c + +DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c} +CLEANFILES+= ${DPSRCS} + .if !empty(SRCS:N*.h:N*.sh) -OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} -LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} +OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} +LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} .endif .if defined(OBJS) && !empty(OBJS) -.if defined(DESTDIR) - -${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD} - ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND} +.NOPATH: ${OBJS} +.if defined(BUILDDIR) +# link against the libs in BUILDDIR +${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD} + ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${BUILDDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND} .else - -${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD} +# link against libs in system we're running +${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD} ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} -.endif # defined(DESTDIR) +.endif # defined(BUILDDIR) .endif # defined(OBJS) && !empty(OBJS) .if !defined(MAN) @@ -102,19 +112,12 @@ MAN= ${PROG}.1 .endif # !defined(MAN) .endif # defined(PROG) -all: ${PROG} _SUBDIRUSE +all: ${PROG} -.if !target(clean) cleanprog: rm -f a.out [Ee]rrs mklog core *.core \ ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES} -clean: _SUBDIRUSE cleanprog -cleandir: _SUBDIRUSE cleanprog -.else -cleandir: _SUBDIRUSE clean -.endif - .if defined(SRCS) afterdepend: .depend @(TMP=/tmp/_depend$$$$; \ @@ -123,17 +126,7 @@ afterdepend: .depend mv $$TMP .depend) .endif -.if !target(install) -.if !target(beforeinstall) -beforeinstall: -.endif -.if !target(afterinstall) -afterinstall: -.endif - -.if !target(realinstall) - -.if defined(PROG) +.if defined(PROG) && !target(proginstall) PROGNAME?= ${PROG} proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME} .if !defined(UPDATE) @@ -149,7 +142,11 @@ ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} -m ${BINMODE} ${.ALLSRC} ${.TARGET} .endif -.if defined(SCRIPTS) +.if !target(proginstall) +proginstall:: +.endif + +.if defined(SCRIPTS) && !target(scriptsinstall) SCRIPTSDIR?=${BINDIR} SCRIPTSOWN?=${BINOWN} SCRIPTSGRP?=${BINGRP} @@ -165,7 +162,7 @@ SCRIPTSNAME_${S} ?= ${SCRIPTSNAME} SCRIPTSNAME_${S} ?= ${S:T:R} .endif SCRIPTSDIR_${S} ?= ${SCRIPTSDIR} -proginstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}} +scriptsinstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}} .if !defined(UPDATE) .PHONY: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}} .endif @@ -180,39 +177,22 @@ ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNA .endfor .endif -.if target(proginstall) -realinstall: proginstall filesinstall -.else -realinstall: filesinstall -.endif +.if !target(scriptsinstall) +scriptsinstall:: .endif -install: ${MANINSTALL} _SUBDIRUSE linksinstall - -${MANINSTALL}: afterinstall -afterinstall: realinstall -realinstall: beforeinstall -.endif - -.if !target(lint) lint: ${LOBJS} .if defined(LOBJS) && !empty(LOBJS) @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD} .endif -.endif -.if !defined(NOMAN) .include -.endif - -.if !defined(NONLS) .include -.endif - -.include -.include .include .include +.include .include -.include .include + +# Make sure all of the standard targets are defined, even if they do nothing. +regress: