From cd66f45443f6129d41988a57663605124fce4a75 Mon Sep 17 00:00:00 2001 From: bde Date: Sun, 28 Aug 1994 15:32:10 +0000 Subject: Fix spelling error in little-used target. Build an intermediate object file even when there is only one source file. This costs a little space but saves time if the target is rebuilt a lot, and it stops the target varying with the name of temporary intermediates. Use ${ECHO} instead of `echo' so that `make -s' is fairly quiet. Use ${ECHODIR} instead of echo for printing directory names so that `make -ss' is very quiet. --- share/mk/bsd.prog.mk | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 84246df..d17181b 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.prog.mk,v 1.2 1994/08/04 21:09:25 wollman Exp $ +# $Id: bsd.prog.mk,v 1.3 1994/08/10 02:48:08 wollman Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" @@ -100,7 +100,7 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if defined(LDONLY) ${PROG}: ${LIBCRT0} ${LIBC} ${DPSRCS} ${OBJS} ${DPADD} - ${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDDESTDR} \ + ${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDDESTDIR} \ ${LDADD} .else defined(LDONLY) @@ -112,11 +112,22 @@ ${PROG}: ${DPSRCS} ${OBJS} ${LIBC} ${DPADD} .else defined(PROG) -SRCS= ${PROG}.c +SRCS= ${PROG}.c +.if 0 ${PROG}: ${DPSRCS} ${SRCS} ${LIBC} ${DPADD} ${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} \ ${LDDESTDIR} ${LDADD} +.else +# Always make an intermediate object file because: +# - it saves time rebuilding when only the library has changed +# - the name of the object gets put into the executable symbol table instead of +# the name of a variable temporary object. +# - it's useful to keep objects around for crunching. +OBJS= ${PROG}.o +${PROG}: ${DPSRCS} ${OBJS} ${LIBC} ${DPADD} + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD} +.endif MKDEP= -p @@ -132,7 +143,7 @@ MAN1= ${PROG}.1 _PROGSUBDIR: .USE .if defined(SUBDIR) && !empty(SUBDIR) @for entry in ${SUBDIR}; do \ - (echo "===> $$entry"; \ + (${ECHODIR} "===> $$entry"; \ if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ cd ${.CURDIR}/$${entry}.${MACHINE}; \ else \ @@ -181,7 +192,7 @@ realinstall: _PROGSUBDIR shift; \ t=${DESTDIR}$$1; \ shift; \ - echo $$t -\> $$l; \ + ${ECHO} $$t -\> $$l; \ rm -f $$t; \ ln $$l $$t; \ done; true @@ -210,7 +221,7 @@ obj: _PROGSUBDIR obj: _PROGSUBDIR @cd ${.CURDIR}; rm -rf obj; \ here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ - echo "$$here -> $$dest"; ln -s $$dest obj; \ + ${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \ if test -d /usr/obj -a ! -d $$dest; then \ mkdir -p $$dest; \ else \ -- cgit v1.1