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): add test for legacy local v...



details:   https://anonhg.NetBSD.org/src/rev/a407bdac12c9
branches:  trunk
changeset: 977930:a407bdac12c9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Nov 05 18:08:39 2020 +0000

description:
make(1): add test for legacy local variables @F, @D

diffstat:

 usr.bin/make/unit-tests/var-class-local.exp |   3 +++
 usr.bin/make/unit-tests/var-class-local.mk  |  16 +++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diffs (39 lines):

diff -r 3dc7d894c464 -r a407bdac12c9 usr.bin/make/unit-tests/var-class-local.exp
--- a/usr.bin/make/unit-tests/var-class-local.exp       Thu Nov 05 18:05:06 2020 +0000
+++ b/usr.bin/make/unit-tests/var-class-local.exp       Thu Nov 05 18:08:39 2020 +0000
@@ -1,2 +1,5 @@
+: Making var-class-local.c out of nothing.
+: Making var-class-local.o from var-class-local.c.
+: Making basename "var-class-local.o" in "." from "var-class-local.c" in ".".
 : all overwritten
 exit status 0
diff -r 3dc7d894c464 -r a407bdac12c9 usr.bin/make/unit-tests/var-class-local.mk
--- a/usr.bin/make/unit-tests/var-class-local.mk        Thu Nov 05 18:05:06 2020 +0000
+++ b/usr.bin/make/unit-tests/var-class-local.mk        Thu Nov 05 18:08:39 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: var-class-local.mk,v 1.4 2020/10/25 09:46:25 rillig Exp $
+# $NetBSD: var-class-local.mk,v 1.5 2020/11/05 18:08:39 rillig Exp $
 #
 # Tests for target-local variables, such as ${.TARGET} or $@.
 
@@ -25,6 +25,20 @@
 .endif
 
 all:
+
+.SUFFIXES: .c .o
+
+var-class-local.c:
+       : Making ${.TARGET} out of nothing.
+
+.c.o:
+       : Making ${.TARGET} from ${.IMPSRC}.
+
+       # The local variables @F, @D, <F, <D are legacy forms.
+       # See the manual page for details.
+       : Making basename "${@F}" in "${@D}" from "${<F}" in "${<D}".
+
+all: var-class-local.o
        # The ::= modifier overwrites the .TARGET variable in the node
        # 'all', not in the global scope.  This can be seen with the -dv
        # option, looking for "all:@ = overwritten".



Home | Main Index | Thread Index | Old Index