Module Name: src
Committed By: rillig
Date: Sun Nov 8 10:17:55 UTC 2020
Modified Files:
src/usr.bin/make: make.c
src/usr.bin/make/unit-tests: depsrc-optional.exp depsrc-optional.mk
Log Message:
make(1): add test for wrong debug message in GNode_IsOODate
To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/usr.bin/make/make.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/depsrc-optional.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/depsrc-optional.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.195 src/usr.bin/make/make.c:1.196
--- src/usr.bin/make/make.c:1.195 Sun Nov 8 09:48:52 2020
+++ src/usr.bin/make/make.c Sun Nov 8 10:17:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.195 2020/11/08 09:48:52 rillig Exp $ */
+/* $NetBSD: make.c,v 1.196 2020/11/08 10:17:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -108,7 +108,7 @@
#include "job.h"
/* "@(#)make.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: make.c,v 1.195 2020/11/08 09:48:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.196 2020/11/08 10:17:55 rillig Exp $");
/* Sequence # to detect recursion. */
static unsigned int checked = 1;
@@ -296,7 +296,7 @@ GNode_IsOODate(GNode *gn)
if (DEBUG(MAKE)) {
if (gn->youngestChild != NULL &&
gn->mtime < gn->youngestChild->mtime) {
- debug_printf("modified before source %s...",
+ debug_printf("modified before source \"%s\"...",
GNode_Path(gn->youngestChild));
} else if (gn->mtime == 0) {
debug_printf("non-existent and no sources...");
Index: src/usr.bin/make/unit-tests/depsrc-optional.exp
diff -u src/usr.bin/make/unit-tests/depsrc-optional.exp:1.2 src/usr.bin/make/unit-tests/depsrc-optional.exp:1.3
--- src/usr.bin/make/unit-tests/depsrc-optional.exp:1.2 Sat Sep 5 15:57:12 2020
+++ src/usr.bin/make/unit-tests/depsrc-optional.exp Sun Nov 8 10:17:55 2020
@@ -1,2 +1,20 @@
-`all' is up to date.
+Make_ExpandUse: examine all
+MakeAddChild: need to examine important
+Make_ExpandUse: examine important
+MakeAddChild: need to examine optional
+MakeAddChild: need to examine optional-cohort
+Make_ExpandUse: examine optional
+Make_ExpandUse: examine optional-cohort
+Examining optional...non-existent...up-to-date.
+Examining optional-cohort...non-existent...non-existent and no sources...out-of-date.
+: This is not executed.
+ recheck(optional-cohort): update time from 0:00:00 Jan 01, 1970 to now
+Examining important...non-existent...modified before source "optional-cohort"...out-of-date.
+: important is made.
+ recheck(important): update time from 0:00:00 Jan 01, 1970 to now
+Examining all...non-existent...modified before source "important"...out-of-date.
+: all is made.
+ recheck(all): update time from 0:00:00 Jan 01, 1970 to now
+Examining .END...non-existent...non-existent and no sources...out-of-date.
+ recheck(.END): update time from 0:00:00 Jan 01, 1970 to now
exit status 0
Index: src/usr.bin/make/unit-tests/depsrc-optional.mk
diff -u src/usr.bin/make/unit-tests/depsrc-optional.mk:1.3 src/usr.bin/make/unit-tests/depsrc-optional.mk:1.4
--- src/usr.bin/make/unit-tests/depsrc-optional.mk:1.3 Sat Sep 5 15:57:12 2020
+++ src/usr.bin/make/unit-tests/depsrc-optional.mk Sun Nov 8 10:17:55 2020
@@ -1,4 +1,4 @@
-# $NetBSD: depsrc-optional.mk,v 1.3 2020/09/05 15:57:12 rillig Exp $
+# $NetBSD: depsrc-optional.mk,v 1.4 2020/11/08 10:17:55 rillig Exp $
#
# Tests for the special source .OPTIONAL in dependency declarations,
# which ignores the target if make cannot find out how to create it.
@@ -11,8 +11,15 @@
all: important
: ${.TARGET} is made.
-important: optional
+important: optional optional-cohort
: ${.TARGET} is made.
optional: .OPTIONAL
: This is not executed.
+
+# XXX: "non-existent and no sources" is wrong, should be ":: operator and
+# no sources..." instead.
+optional-cohort:: .OPTIONAL
+ : This is not executed.
+
+.MAKEFLAGS: -dm