Module Name: src
Committed By: rillig
Date: Sat May 7 08:01:20 UTC 2022
Modified Files:
src/usr.bin/make: compat.c job.c main.c make.h
src/usr.bin/make/unit-tests: compat-error.mk deptgt-begin.mk
deptgt-end-fail-indirect.mk deptgt-end-fail.mk
Log Message:
make: rename Compat_Run to Compat_MakeAll
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/usr.bin/make/compat.c
cvs rdiff -u -r1.452 -r1.453 src/usr.bin/make/job.c
cvs rdiff -u -r1.580 -r1.581 src/usr.bin/make/main.c
cvs rdiff -u -r1.300 -r1.301 src/usr.bin/make/make.h
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/compat-error.mk
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/deptgt-begin.mk
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/deptgt-end-fail.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/compat.c
diff -u src/usr.bin/make/compat.c:1.238 src/usr.bin/make/compat.c:1.239
--- src/usr.bin/make/compat.c:1.238 Sat Jan 22 18:59:23 2022
+++ src/usr.bin/make/compat.c Sat May 7 08:01:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.238 2022/01/22 18:59:23 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.239 2022/05/07 08:01:20 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,16 +70,11 @@
*/
/*
- * compat.c --
- * The routines in this file implement the full-compatibility
- * mode of PMake. Most of the special functionality of PMake
- * is available in this mode. Things not supported:
- * - different shells.
- * - friendly variable substitution.
+ * This file implements the full-compatibility mode of make, which makes the
+ * targets without parallelism and without a custom shell.
*
* Interface:
- * Compat_Run Initialize things for this module and recreate
- * thems as need creatin'
+ * Compat_MakeAll Initialize this module and make the given targets.
*/
#include <sys/types.h>
@@ -96,7 +91,7 @@
#include "pathnames.h"
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.238 2022/01/22 18:59:23 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.239 2022/05/07 08:01:20 rillig Exp $");
static GNode *curTarg = NULL;
static pid_t compatChild;
@@ -689,14 +684,8 @@ InitSignals(void)
bmake_signal(SIGQUIT, CompatInterrupt);
}
-/*
- * Initialize this module and start making.
- *
- * Input:
- * targs The target nodes to re-create
- */
void
-Compat_Run(GNodeList *targs)
+Compat_MakeAll(GNodeList *targs)
{
GNode *errorNode = NULL;
Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.452 src/usr.bin/make/job.c:1.453
--- src/usr.bin/make/job.c:1.452 Sat Feb 12 11:14:48 2022
+++ src/usr.bin/make/job.c Sat May 7 08:01:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.452 2022/02/12 11:14:48 rillig Exp $ */
+/* $NetBSD: job.c,v 1.453 2022/05/07 08:01:20 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.452 2022/02/12 11:14:48 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.453 2022/05/07 08:01:20 rillig Exp $");
/*
* A shell defines how the commands are run. All commands for a target are
@@ -2303,7 +2303,7 @@ Job_Init(void)
(void)Job_RunTarget(".BEGIN", NULL);
/*
* Create the .END node now, even though no code in the unit tests
- * depends on it. See also Targ_GetEndNode in Compat_Run.
+ * depends on it. See also Targ_GetEndNode in Compat_MakeAll.
*/
(void)Targ_GetEndNode();
}
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.580 src/usr.bin/make/main.c:1.581
--- src/usr.bin/make/main.c:1.580 Mon Apr 18 15:06:27 2022
+++ src/usr.bin/make/main.c Sat May 7 08:01:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.580 2022/04/18 15:06:27 rillig Exp $ */
+/* $NetBSD: main.c,v 1.581 2022/05/07 08:01:20 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.580 2022/04/18 15:06:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.581 2022/05/07 08:01:20 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -903,11 +903,7 @@ runTargets(void)
/* Traverse the graph, checking on all the targets */
outOfDate = Make_Run(&targs);
} else {
- /*
- * Compat_Init will take care of creating all the
- * targets as well as initializing the module.
- */
- Compat_Run(&targs);
+ Compat_MakeAll(&targs);
outOfDate = false;
}
Lst_Done(&targs); /* Don't free the targets themselves. */
Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.300 src/usr.bin/make/make.h:1.301
--- src/usr.bin/make/make.h:1.300 Mon Apr 18 15:06:27 2022
+++ src/usr.bin/make/make.h Sat May 7 08:01:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.300 2022/04/18 15:06:27 rillig Exp $ */
+/* $NetBSD: make.h,v 1.301 2022/05/07 08:01:20 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -788,7 +788,7 @@ bool Arch_IsLib(GNode *) MAKE_ATTR_USE;
/* compat.c */
bool Compat_RunCommand(const char *, GNode *, StringListNode *);
-void Compat_Run(GNodeList *);
+void Compat_MakeAll(GNodeList *);
void Compat_Make(GNode *, GNode *);
/* cond.c */
Index: src/usr.bin/make/unit-tests/compat-error.mk
diff -u src/usr.bin/make/unit-tests/compat-error.mk:1.3 src/usr.bin/make/unit-tests/compat-error.mk:1.4
--- src/usr.bin/make/unit-tests/compat-error.mk:1.3 Sun Dec 13 19:33:53 2020
+++ src/usr.bin/make/unit-tests/compat-error.mk Sat May 7 08:01:20 2022
@@ -1,4 +1,4 @@
-# $NetBSD: compat-error.mk,v 1.3 2020/12/13 19:33:53 rillig Exp $
+# $NetBSD: compat-error.mk,v 1.4 2022/05/07 08:01:20 rillig Exp $
#
# Test detailed error handling in compat mode.
#
@@ -11,7 +11,7 @@
# XXX: As of 2020-12-13, .ERROR_CMD is empty, which is wrong.
#
# See also:
-# Compat_Run
+# Compat_MakeAll
#
# The commit that added the NULL command to gn->commands:
# CVS: 1994.06.06.22.45.??
Index: src/usr.bin/make/unit-tests/deptgt-begin.mk
diff -u src/usr.bin/make/unit-tests/deptgt-begin.mk:1.5 src/usr.bin/make/unit-tests/deptgt-begin.mk:1.6
--- src/usr.bin/make/unit-tests/deptgt-begin.mk:1.5 Sun Nov 15 22:28:08 2020
+++ src/usr.bin/make/unit-tests/deptgt-begin.mk Sat May 7 08:01:20 2022
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-begin.mk,v 1.5 2020/11/15 22:28:08 rillig Exp $
+# $NetBSD: deptgt-begin.mk,v 1.6 2022/05/07 08:01:20 rillig Exp $
#
# Tests for the special target .BEGIN in dependency declarations,
# which is a container for commands that are run before any other
@@ -25,8 +25,8 @@ before-begin: .PHONY .NOTMAIN
# Another way is to define a custom target and make that a .USE dependency.
# For the .BEGIN target, .USE dependencies do not work though, since in
-# Compat_Run, the .USE and .USEBEFORE nodes are expanded right after the
-# .BEGIN target has been run, which is too late.
+# Compat_MakeAll, the .USE and .USEBEFORE nodes are expanded right after the
+# .BEGIN target has been made, which is too late.
.BEGIN: use
use: .USE .NOTMAIN
: Making $@ from a .USE dependency.
@@ -35,8 +35,8 @@ use: .USE .NOTMAIN
# .BEGIN target.
#
# For the .BEGIN target, .USEBEFORE dependencies do not work though, since in
-# Compat_Run, the .USE and .USEBEFORE nodes are expanded right after the
-# .BEGIN target has been run, which is too late.
+# Compat_MakeAll, the .USE and .USEBEFORE nodes are expanded right after the
+# .BEGIN target has been made, which is too late.
.BEGIN: use-before
use-before: .USEBEFORE .NOTMAIN
: Making $@ from a .USEBEFORE dependency.
Index: src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk
diff -u src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk:1.2 src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk:1.3
--- src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk:1.2 Sun Dec 6 21:22:04 2020
+++ src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk Sat May 7 08:01:20 2022
@@ -1,10 +1,10 @@
-# $NetBSD: deptgt-end-fail-indirect.mk,v 1.2 2020/12/06 21:22:04 rillig Exp $
+# $NetBSD: deptgt-end-fail-indirect.mk,v 1.3 2022/05/07 08:01:20 rillig Exp $
#
# Tests for an error in a dependency of the .END node.
#
# Before 2020-11-25, an error in the .END target did not print the "Stop."
# and exited with status 0. The cause for this was a missing condition in
-# Compat_Run in the handling of the .END node.
+# Compat_MakeAll in the handling of the .END node.
all:
: $@
Index: src/usr.bin/make/unit-tests/deptgt-end-fail.mk
diff -u src/usr.bin/make/unit-tests/deptgt-end-fail.mk:1.6 src/usr.bin/make/unit-tests/deptgt-end-fail.mk:1.7
--- src/usr.bin/make/unit-tests/deptgt-end-fail.mk:1.6 Mon Dec 7 01:04:07 2020
+++ src/usr.bin/make/unit-tests/deptgt-end-fail.mk Sat May 7 08:01:20 2022
@@ -1,11 +1,11 @@
-# $NetBSD: deptgt-end-fail.mk,v 1.6 2020/12/07 01:04:07 rillig Exp $
+# $NetBSD: deptgt-end-fail.mk,v 1.7 2022/05/07 08:01:20 rillig Exp $
#
# Tests for an errors in the main target, its dependencies,
# the .END node and its dependencies.
#
# Before 2020-11-25, an error in the .END target did not print the "Stop.",
# even though this was intended. The cause for this was a missing condition
-# in Compat_Run, in the code handling the .END node.
+# in Compat_MakeAll, in the code handling the .END node.
test: .PHONY