Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/share/mk * use a :M* modifier when testing whether the expan...
details: https://anonhg.NetBSD.org/src/rev/04632902c708
branches: trunk
changeset: 769801:04632902c708
user: apb <apb%NetBSD.org@localhost>
date: Fri Sep 23 21:13:14 2011 +0000
description:
* use a :M* modifier when testing whether the expanded list of
files is empty. Sometimes the variable contains one or more spaces,
and testing against "" gave the wrong result, but applying the
:M* modifier discards the spaces. This should fix PR 45396.
* Instead of using "-" to ignore the exit status from the rm command,
use ||true. This should work around the bug in PR 45356, but that
bug is not fixed.
* Suppress the ${MKMSG} command with .if 0. People who build with
MAKEVERBOSE=1 don't want to see the message, and people who build
with MAKEVERBOSE=2 or higher will see the actual rm command. The
message may be useful for debugging this makefile itself, so it's
only disabled, not deleted.
diffstat:
share/mk/bsd.clean.mk | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (30 lines):
diff -r 36e564ee1138 -r 04632902c708 share/mk/bsd.clean.mk
--- a/share/mk/bsd.clean.mk Fri Sep 23 16:41:16 2011 +0000
+++ b/share/mk/bsd.clean.mk Fri Sep 23 21:13:14 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.clean.mk,v 1.2 2011/09/10 19:25:10 apb Exp $
+# $NetBSD: bsd.clean.mk,v 1.3 2011/09/23 21:13:14 apb Exp $
# <bsd.clean.mk>
#
@@ -41,14 +41,16 @@
# both .OBJDIR and .SRCDIR.
#
__cleanuse: .USE
- ${"${.ALLSRC:@v@${${v}}@}" == "":?@true:${_MKMSG} \
+.if 0 # print "# clean CLEANFILES" for debugging
+ ${"${.ALLSRC:@v@${${v}:M*}@}" == "":?@true:${_MKMSG} \
"clean" ${.ALLSRC} }
+.endif
.for _d in ${"${.OBJDIR}" == "${.CURDIR}" \
:? ${.OBJDIR} \
: ${.OBJDIR} ${.CURDIR} }
- -${"${.ALLSRC:@v@${${v}}@}" == "":?@true: \
- (cd ${_d} && rm -f ${.ALLSRC:@v@${${v}}@}) }
- @${"${.ALLSRC:@v@${${v}}@}" == "":?true: \
+ ${"${.ALLSRC:@v@${${v}:M*}@}" == "":?@true: \
+ (cd ${_d} && rm -f ${.ALLSRC:@v@${${v}}@} || true) }
+ @${"${.ALLSRC:@v@${${v}:M*}@}" == "":?true: \
bad="\$(cd ${_d} && ls -d ${.ALLSRC:@v@${${v}}@} 2>/dev/null)"; \
if test -n "\$bad"; then \
echo "Failed to remove files from ${_d}:" ; \
Home |
Main Index |
Thread Index |
Old Index