Module Name: src
Committed By: rillig
Date: Mon Sep 14 18:27:16 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: deptgt.exp deptgt.mk
Log Message:
make(1): in the deptgt test, describe what happens to the targets
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/deptgt.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/deptgt.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/unit-tests/deptgt.exp
diff -u src/usr.bin/make/unit-tests/deptgt.exp:1.3 src/usr.bin/make/unit-tests/deptgt.exp:1.4
--- src/usr.bin/make/unit-tests/deptgt.exp:1.3 Mon Sep 14 18:21:26 2020
+++ src/usr.bin/make/unit-tests/deptgt.exp Mon Sep 14 18:27:15 2020
@@ -1,5 +1,5 @@
make: "deptgt.mk" line 10: warning: Extra target ignored
-make: "deptgt.mk" line 27: Unassociated shell command ": command3"
+make: "deptgt.mk" line 28: Unassociated shell command ": command3 # parse error, since targets == NULL"
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.4 src/usr.bin/make/unit-tests/deptgt.mk:1.5
--- src/usr.bin/make/unit-tests/deptgt.mk:1.4 Mon Sep 14 18:21:26 2020
+++ src/usr.bin/make/unit-tests/deptgt.mk Mon Sep 14 18:27:15 2020
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt.mk,v 1.4 2020/09/14 18:21:26 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.5 2020/09/14 18:27:15 rillig Exp $
#
# Tests for special targets like .BEGIN or .SUFFIXES in dependency
# declarations.
@@ -9,9 +9,7 @@
# dependency line: That doesn't work, and make immediately rejects it.
.SUFFIXES .PHONY: .c.o
-# Keyword "parse.c:targets"
-#
-# The following lines demonstrate how 'target' is set and reset during
+# The following lines demonstrate how 'targets' is set and reset during
# parsing of dependencies. To see it in action, set breakpoints in:
#
# ParseDoDependency at the beginning
@@ -20,11 +18,14 @@
# Parse_File at "targets = Lst_Init()"
# Parse_File at "!inLine"
#
-target1 target2: sources
- : command1
- : command2
-VAR=value
- : command3
+# Keywords:
+# parse.c:targets
+
+target1 target2: sources # targets := [target1, target2]
+ : command1 # targets == [target1, target2]
+ : command2 # targets == [target1, target2]
+VAR=value # targets := NULL
+ : command3 # parse error, since targets == NULL
all:
@:;