Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests make(1): test that suffixes can be l...
details: https://anonhg.NetBSD.org/src/rev/2212518cf5eb
branches: trunk
changeset: 957233:2212518cf5eb
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Nov 21 21:54:42 2020 +0000
description:
make(1): test that suffixes can be listed in any order
diffstat:
usr.bin/make/unit-tests/deptgt-suffixes.exp | 26 ++++++++++++++++++++++++++
usr.bin/make/unit-tests/deptgt-suffixes.mk | 23 ++++++++++++++++++++---
2 files changed, 46 insertions(+), 3 deletions(-)
diffs (75 lines):
diff -r b0c954948dc4 -r 2212518cf5eb usr.bin/make/unit-tests/deptgt-suffixes.exp
--- a/usr.bin/make/unit-tests/deptgt-suffixes.exp Sat Nov 21 21:41:27 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-suffixes.exp Sat Nov 21 21:54:42 2020 +0000
@@ -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
diff -r b0c954948dc4 -r 2212518cf5eb usr.bin/make/unit-tests/deptgt-suffixes.mk
--- a/usr.bin/make/unit-tests/deptgt-suffixes.mk Sat Nov 21 21:41:27 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-suffixes.mk Sat Nov 21 21:54:42 2020 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index