Module Name:    src
Committed By:   rillig
Date:           Sat Nov 21 21:54:42 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: deptgt-suffixes.exp deptgt-suffixes.mk

Log Message:
make(1): test that suffixes can be listed in any order


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/deptgt-suffixes.exp \
    src/usr.bin/make/unit-tests/deptgt-suffixes.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-suffixes.exp
diff -u src/usr.bin/make/unit-tests/deptgt-suffixes.exp:1.3 src/usr.bin/make/unit-tests/deptgt-suffixes.exp:1.4
--- src/usr.bin/make/unit-tests/deptgt-suffixes.exp:1.3	Wed Oct 21 08:20:13 2020
+++ src/usr.bin/make/unit-tests/deptgt-suffixes.exp	Sat Nov 21 21:54:42 2020
@@ -3,5 +3,31 @@
 #	To: 
 #	From: 
 #	Search Path: . .. 
+# ".src-left" (num 2, ref 2)
+#	To: .tgt-right 
+#	From: 
+#	Search Path: 
+# ".tgt-right" (num 3, ref 2)
+#	To: 
+#	From: .src-left 
+#	Search Path: 
+# ".tgt-left" (num 4, ref 2)
+#	To: 
+#	From: .src-right 
+#	Search Path: 
+# ".src-right" (num 5, ref 2)
+#	To: .tgt-left 
+#	From: 
+#	Search Path: 
 #*** Transformations:
+.src-left.tgt-right:
+	: Making ${.TARGET} from ${.IMPSRC}.
+
+.src-right.tgt-left:
+	: Making ${.TARGET} from ${.IMPSRC}.
+
+: Making deptgt-suffixes.src-left out of nothing.
+: Making deptgt-suffixes.tgt-right from deptgt-suffixes.src-left.
+: Making deptgt-suffixes.src-right out of nothing.
+: Making deptgt-suffixes.tgt-left from deptgt-suffixes.src-right.
 exit status 0
Index: src/usr.bin/make/unit-tests/deptgt-suffixes.mk
diff -u src/usr.bin/make/unit-tests/deptgt-suffixes.mk:1.3 src/usr.bin/make/unit-tests/deptgt-suffixes.mk:1.4
--- src/usr.bin/make/unit-tests/deptgt-suffixes.mk:1.3	Fri Aug 28 04:05:35 2020
+++ src/usr.bin/make/unit-tests/deptgt-suffixes.mk	Sat Nov 21 21:54:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-suffixes.mk,v 1.3 2020/08/28 04:05:35 rillig Exp $
+# $NetBSD: deptgt-suffixes.mk,v 1.4 2020/11/21 21:54:42 rillig Exp $
 #
 # Tests for the special target .SUFFIXES in dependency declarations.
 #
@@ -8,11 +8,28 @@
 
 .MAKEFLAGS: -dg1
 
+.MAIN: all
+
 .SUFFIXES: .custom-null
 
 # TODO: What is the effect of this? How is it useful?
 .NULL: .custom-null
 .PATH.custom-null: . ..
 
-all:
-	@:;
+# The order in which the suffixes are listed doesn't matter.
+# Here, they are listed from source to target, just like in the transformation
+# rule below it.
+.SUFFIXES: .src-left .tgt-right
+deptgt-suffixes.src-left:
+	: Making ${.TARGET} out of nothing.
+.src-left.tgt-right:
+	: Making ${.TARGET} from ${.IMPSRC}.
+all: deptgt-suffixes.tgt-right
+
+# Here, the target is listed earlier than the source.
+.SUFFIXES: .tgt-left .src-right
+deptgt-suffixes.src-right:
+	: Making ${.TARGET} out of nothing.
+.src-right.tgt-left:
+	: Making ${.TARGET} from ${.IMPSRC}.
+all: deptgt-suffixes.tgt-left

Reply via email to