Add test case for FLAGS dependent on .TARGET
This commit is contained in:
parent
ac669aab65
commit
95f6f1e60d
|
@ -69,4 +69,6 @@ make: Unclosed variable "UNCLOSED.3"
|
||||||
make: Unclosed variable "UNCLOSED_ORIG"
|
make: Unclosed variable "UNCLOSED_ORIG"
|
||||||
|
|
||||||
varerror-unclosed:end
|
varerror-unclosed:end
|
||||||
|
target1-flags: we have: one two
|
||||||
|
target2-flags: we have: one two three four
|
||||||
exit status 0
|
exit status 0
|
||||||
|
|
|
@ -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.
|
# Miscellaneous variable tests.
|
||||||
|
|
||||||
|
@ -198,6 +198,20 @@ parse-dynamic:
|
||||||
UNCLOSED_INDIR_1= ${UNCLOSED_ORIG
|
UNCLOSED_INDIR_1= ${UNCLOSED_ORIG
|
||||||
UNCLOSED_INDIR_2= ${UNCLOSED_INDIR_1}
|
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:
|
varerror-unclosed:
|
||||||
@echo $@:begin
|
@echo $@:begin
|
||||||
@echo $(
|
@echo $(
|
||||||
|
|
Loading…
Reference in New Issue