Module Name:    src
Committed By:   sjg
Date:           Sat Sep  9 16:41:04 UTC 2023

Modified Files:
        src/usr.bin/make: main.c make.1
        src/usr.bin/make/unit-tests: Makefile opt-debug-graph1.exp
            opt-debug-graph2.exp opt-debug-graph3.exp suff-main-several.exp
            suff-transform-debug.exp

Log Message:
Add .MAKE.JOBS.C to indicate wether -jC is supported


To generate a diff of this commit:
cvs rdiff -u -r1.595 -r1.596 src/usr.bin/make/main.c
cvs rdiff -u -r1.369 -r1.370 src/usr.bin/make/make.1
cvs rdiff -u -r1.340 -r1.341 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/opt-debug-graph1.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt-debug-graph2.exp \
    src/usr.bin/make/unit-tests/opt-debug-graph3.exp \
    src/usr.bin/make/unit-tests/suff-transform-debug.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/suff-main-several.exp

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/main.c
diff -u src/usr.bin/make/main.c:1.595 src/usr.bin/make/main.c:1.596
--- src/usr.bin/make/main.c:1.595	Sat Sep  9 04:38:48 2023
+++ src/usr.bin/make/main.c	Sat Sep  9 16:41:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.595 2023/09/09 04:38:48 mrg Exp $	*/
+/*	$NetBSD: main.c,v 1.596 2023/09/09 16:41:04 sjg 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.595 2023/09/09 04:38:48 mrg Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.596 2023/09/09 16:41:04 sjg Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	    "The Regents of the University of California.  "
@@ -1373,6 +1373,12 @@ main_Init(int argc, char **argv)
 #endif
 	Global_Set(".MAKE.MAKEFILE_PREFERENCE", MAKEFILE_PREFERENCE_LIST);
 	Global_Set(".MAKE.DEPENDFILE", ".depend");
+	/* Tell makefiles like jobs.mk wether we support -jC */
+#ifdef _SC_NPROCESSORS_ONLN
+	Global_Set_ReadOnly(".MAKE.JOBS.C", "yes");
+#else
+	Global_Set_ReadOnly(".MAKE.JOBS.C", "no");
+#endif
 
 	CmdOpts_Init();
 	allPrecious = false;	/* Remove targets when interrupted */

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.369 src/usr.bin/make/make.1:1.370
--- src/usr.bin/make/make.1:1.369	Sat Sep  9 01:30:59 2023
+++ src/usr.bin/make/make.1	Sat Sep  9 16:41:04 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.369 2023/09/09 01:30:59 sjg Exp $
+.\"	$NetBSD: make.1,v 1.370 2023/09/09 16:41:04 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -977,6 +977,11 @@ making it easier to track the degree of 
 The argument to the
 .Fl j
 option.
+.It Va .MAKE.JOBS.C
+A read-only boolean that indicates wether the
+.Fl j
+option supports use of
+.Ql C .
 .It Va .MAKE.LEVEL
 The recursion depth of
 .Nm .

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.340 src/usr.bin/make/unit-tests/Makefile:1.341
--- src/usr.bin/make/unit-tests/Makefile:1.340	Thu Aug 17 18:48:32 2023
+++ src/usr.bin/make/unit-tests/Makefile	Sat Sep  9 16:41:04 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.340 2023/08/17 18:48:32 rillig Exp $
+# $NetBSD: Makefile,v 1.341 2023/09/09 16:41:04 sjg Exp $
 #
 # Unit tests for make(1)
 #
@@ -597,6 +597,7 @@ STD_SED_CMDS.dg1=	-e 's,${.CURDIR}$$,<cu
 STD_SED_CMDS.dg1+=	-e 's,  ${DEFSYSPATH:U/usr/share/mk}$$,  <defsyspath>,'
 STD_SED_CMDS.dg1+=	-e 's,^\(\.MAKE *=\) .*,\1 <details omitted>,'
 STD_SED_CMDS.dg1+=	-e 's,^\(\.MAKE\.[A-Z_]* *=\) .*,\1 <details omitted>,'
+STD_SED_CMDS.dg1+=	-e 's,^\(\.MAKE\.JOBS\.C *=\) .*,\1 <details omitted>,'
 STD_SED_CMDS.dg1+=	-e 's,^\(MACHINE[_ARCH]* *=\) .*,\1 <details omitted>,'
 STD_SED_CMDS.dg1+=	-e 's,^\(MAKE *=\) .*,\1 <details omitted>,'
 STD_SED_CMDS.dg1+=	-e 's,^\(\.SHELL *=\) .*,\1 <details omitted>,'

Index: src/usr.bin/make/unit-tests/opt-debug-graph1.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.11 src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.12
--- src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.11	Tue Jan 24 00:24:02 2023
+++ src/usr.bin/make/unit-tests/opt-debug-graph1.exp	Sat Sep  9 16:41:04 2023
@@ -21,6 +21,7 @@
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
+.MAKE.JOBS.C     = <details omitted>
 .MAKE.LEVEL      = <details omitted>
 .MAKE.MAKEFILES  = <details omitted>
 .MAKE.MAKEFILE_PREFERENCE = <details omitted>

Index: src/usr.bin/make/unit-tests/opt-debug-graph2.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-graph2.exp:1.6 src/usr.bin/make/unit-tests/opt-debug-graph2.exp:1.7
--- src/usr.bin/make/unit-tests/opt-debug-graph2.exp:1.6	Tue Jan 24 00:24:02 2023
+++ src/usr.bin/make/unit-tests/opt-debug-graph2.exp	Sat Sep  9 16:41:04 2023
@@ -55,6 +55,7 @@ all             : made-target error-targ
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
+.MAKE.JOBS.C     = <details omitted>
 .MAKE.LEVEL      = <details omitted>
 .MAKE.MAKEFILES  = <details omitted>
 .MAKE.MAKEFILE_PREFERENCE = <details omitted>
Index: src/usr.bin/make/unit-tests/opt-debug-graph3.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-graph3.exp:1.6 src/usr.bin/make/unit-tests/opt-debug-graph3.exp:1.7
--- src/usr.bin/make/unit-tests/opt-debug-graph3.exp:1.6	Tue Jan 24 00:24:02 2023
+++ src/usr.bin/make/unit-tests/opt-debug-graph3.exp	Sat Sep  9 16:41:04 2023
@@ -55,6 +55,7 @@ all             : made-target error-targ
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
+.MAKE.JOBS.C     = <details omitted>
 .MAKE.LEVEL      = <details omitted>
 .MAKE.MAKEFILES  = <details omitted>
 .MAKE.MAKEFILE_PREFERENCE = <details omitted>
Index: src/usr.bin/make/unit-tests/suff-transform-debug.exp
diff -u src/usr.bin/make/unit-tests/suff-transform-debug.exp:1.6 src/usr.bin/make/unit-tests/suff-transform-debug.exp:1.7
--- src/usr.bin/make/unit-tests/suff-transform-debug.exp:1.6	Tue Jan 24 00:24:02 2023
+++ src/usr.bin/make/unit-tests/suff-transform-debug.exp	Sat Sep  9 16:41:04 2023
@@ -12,6 +12,7 @@
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
+.MAKE.JOBS.C     = <details omitted>
 .MAKE.LEVEL      = <details omitted>
 .MAKE.MAKEFILES  = <details omitted>
 .MAKE.MAKEFILE_PREFERENCE = <details omitted>

Index: src/usr.bin/make/unit-tests/suff-main-several.exp
diff -u src/usr.bin/make/unit-tests/suff-main-several.exp:1.9 src/usr.bin/make/unit-tests/suff-main-several.exp:1.10
--- src/usr.bin/make/unit-tests/suff-main-several.exp:1.9	Tue Jan 24 00:24:02 2023
+++ src/usr.bin/make/unit-tests/suff-main-several.exp	Sat Sep  9 16:41:04 2023
@@ -86,6 +86,7 @@ ParseDependency(.MAKEFLAGS: -d0 -dg1)
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
+.MAKE.JOBS.C     = <details omitted>
 .MAKE.LEVEL      = <details omitted>
 .MAKE.MAKEFILES  = <details omitted>
 .MAKE.MAKEFILE_PREFERENCE = <details omitted>

Reply via email to