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 Add test case for FLAGS dependent on...



details:   https://anonhg.NetBSD.org/src/rev/aa456ce26e9d
branches:  trunk
changeset: 938030:aa456ce26e9d
user:      sjg <sjg%NetBSD.org@localhost>
date:      Mon Aug 31 16:20:00 2020 +0000

description:
Add test case for FLAGS dependent on .TARGET

diffstat:

 usr.bin/make/unit-tests/varmisc.exp |   2 ++
 usr.bin/make/unit-tests/varmisc.mk  |  16 +++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 57e0d51b65a1 -r aa456ce26e9d usr.bin/make/unit-tests/varmisc.exp
--- a/usr.bin/make/unit-tests/varmisc.exp       Mon Aug 31 15:32:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.exp       Mon Aug 31 16:20:00 2020 +0000
@@ -69,4 +69,6 @@
 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
diff -r 57e0d51b65a1 -r aa456ce26e9d usr.bin/make/unit-tests/varmisc.mk
--- a/usr.bin/make/unit-tests/varmisc.mk        Mon Aug 31 15:32:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.mk        Mon Aug 31 16:20:00 2020 +0000
@@ -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 @@
 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 $(



Home | Main Index | Thread Index | Old Index