mirror of
https://github.com/mirror/make.git
synced 2026-09-05 22:25:00 +08:00
[SV 59870] define/undefine prerequisites are not target-specific vars
* src/read.c (parse_var_assignment): If called in a target-specific variable context don't allow define/undefine as variable assignments. * test/scripts/variables/define: Add a test. * test/scripts/variables/undefine: Add a test.
This commit is contained in:
@@ -279,4 +279,22 @@ hello
|
||||
world
|
||||
');
|
||||
|
||||
# Ensure that define can be a target when not appearing in a variable
|
||||
# definition context. See SV 59870
|
||||
|
||||
run_make_test(q!
|
||||
define = define
|
||||
|
||||
$(define) : ;@echo $@
|
||||
|
||||
%:define
|
||||
|
||||
all: define foo
|
||||
|
||||
%.x : define
|
||||
|
||||
foo:;
|
||||
!,
|
||||
'', "define\n");
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user