Module Name: src
Committed By: sjg
Date: Mon Aug 31 16:20:00 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: varmisc.exp varmisc.mk
Log Message:
Add test case for FLAGS dependent on .TARGET
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/make/unit-tests/varmisc.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/varmisc.exp
diff -u src/usr.bin/make/unit-tests/varmisc.exp:1.15 src/usr.bin/make/unit-tests/varmisc.exp:1.16
--- src/usr.bin/make/unit-tests/varmisc.exp:1.15 Thu Jul 30 13:50:27 2020
+++ src/usr.bin/make/unit-tests/varmisc.exp Mon Aug 31 16:20:00 2020
@@ -69,4 +69,6 @@ make: Unclosed variable "UNCLOSED.3"
make: Unclosed variable "UNCLOSED_ORIG"
varerror-unclosed:end
+target1-flags: we have: one two
+target2-flags: we have: one two three four
exit status 0
Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.22 src/usr.bin/make/unit-tests/varmisc.mk:1.23
--- src/usr.bin/make/unit-tests/varmisc.mk:1.22 Sun Aug 23 19:30:13 2020
+++ src/usr.bin/make/unit-tests/varmisc.mk Mon Aug 31 16:20:00 2020
@@ -1,4 +1,4 @@
-# $Id: varmisc.mk,v 1.22 2020/08/23 19:30:13 rillig Exp $
+# $Id: varmisc.mk,v 1.23 2020/08/31 16:20:00 sjg Exp $
#
# Miscellaneous variable tests.
@@ -198,6 +198,20 @@ parse-dynamic:
UNCLOSED_INDIR_1= ${UNCLOSED_ORIG
UNCLOSED_INDIR_2= ${UNCLOSED_INDIR_1}
+FLAGS= one two
+FLAGS+= ${FLAGS.${.ALLSRC:M*.c:T:u}}
+FLAGS.target2.c = three four
+
+target1.c:
+target2.c:
+
+all: target1-flags target2-flags
+target1-flags: target1.c
+ @echo $@: we have: ${FLAGS}
+
+target2-flags: target2.c
+ @echo $@: we have: ${FLAGS}
+
varerror-unclosed:
@echo $@:begin
@echo $(