mirror of
https://github.com/mirror/make.git
synced 2025-03-27 20:40:35 +08:00
- Fix Savannah bug #24622
This commit is contained in:
parent
0b30c8d9ce
commit
a72bff7cb3
@ -1,5 +1,10 @@
|
|||||||
2009-06-07 Paul Smith <psmith@gnu.org>
|
2009-06-07 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* file.c (snap_deps): Set SNAPPED_DEPS at the start of snapping,
|
||||||
|
not the end, to catch second expansion $(eval ...) defining new
|
||||||
|
target/prereq relationships during snap_deps.
|
||||||
|
Fixes Savannah bug #24622.
|
||||||
|
|
||||||
* read.c (record_files): The second-expansion "f->updating" hack
|
* read.c (record_files): The second-expansion "f->updating" hack
|
||||||
was not completely correct: if assumed that the target with
|
was not completely correct: if assumed that the target with
|
||||||
commands always had prerequisites; if one didn't then the ordering
|
commands always had prerequisites; if one didn't then the ordering
|
||||||
|
8
file.c
8
file.c
@ -638,6 +638,10 @@ snap_deps (void)
|
|||||||
struct file **file_slot;
|
struct file **file_slot;
|
||||||
struct file **file_end;
|
struct file **file_end;
|
||||||
|
|
||||||
|
/* Remember that we've done this. Once we start snapping deps we can no
|
||||||
|
longer define new targets. */
|
||||||
|
snapped_deps = 1;
|
||||||
|
|
||||||
/* Perform second expansion and enter each dependency name as a file. */
|
/* Perform second expansion and enter each dependency name as a file. */
|
||||||
|
|
||||||
/* Expand .SUFFIXES first; it's dependencies are used for $$* calculation. */
|
/* Expand .SUFFIXES first; it's dependencies are used for $$* calculation. */
|
||||||
@ -737,10 +741,6 @@ snap_deps (void)
|
|||||||
define_variable (STRING_SIZE_TUPLE("OUTPUT_OPTION"), "", o_default, 1);
|
define_variable (STRING_SIZE_TUPLE("OUTPUT_OPTION"), "", o_default, 1);
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Remember that we've done this. Once done we can no longer define
|
|
||||||
new targets. */
|
|
||||||
snapped_deps = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the `command_state' member of FILE and all its `also_make's. */
|
/* Set the `command_state' member of FILE and all its `also_make's. */
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2009-06-07 Paul Smith <psmith@gnu.org>
|
2009-06-07 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* scripts/features/se_explicit: Make sure we catch defining
|
||||||
|
prereqs during snap_deps(). Savannah bug #24622.
|
||||||
|
|
||||||
* scripts/variables/automatic: Check prereq ordering when the
|
* scripts/variables/automatic: Check prereq ordering when the
|
||||||
target with the recipe has no prereqs. Savannah bug #21198.
|
target with the recipe has no prereqs. Savannah bug #21198.
|
||||||
|
|
||||||
|
@ -86,31 +86,19 @@ run_make_test('
|
|||||||
all: foo bar baz
|
all: foo bar baz
|
||||||
|
|
||||||
# Subtest #1
|
# Subtest #1
|
||||||
#
|
|
||||||
foo: foo.1; @:
|
foo: foo.1; @:
|
||||||
|
|
||||||
foo: foo.2
|
foo: foo.2
|
||||||
|
|
||||||
foo: foo.3
|
foo: foo.3
|
||||||
|
|
||||||
|
|
||||||
# Subtest #2
|
# Subtest #2
|
||||||
#
|
|
||||||
bar: bar.2
|
bar: bar.2
|
||||||
|
|
||||||
bar: bar.1; @:
|
bar: bar.1; @:
|
||||||
|
|
||||||
bar: bar.3
|
bar: bar.3
|
||||||
|
|
||||||
|
|
||||||
# Subtest #3
|
# Subtest #3
|
||||||
#
|
|
||||||
baz: baz.1
|
baz: baz.1
|
||||||
|
|
||||||
baz: baz.2
|
baz: baz.2
|
||||||
|
|
||||||
baz: ; @:
|
baz: ; @:
|
||||||
|
|
||||||
',
|
',
|
||||||
'',
|
'',
|
||||||
'foo.1
|
'foo.1
|
||||||
@ -129,6 +117,18 @@ run_make_test('
|
|||||||
all : $$(eval $$(info test))
|
all : $$(eval $$(info test))
|
||||||
', '', "test\n#MAKE#: Nothing to be done for `all'.\n");
|
', '', "test\n#MAKE#: Nothing to be done for `all'.\n");
|
||||||
|
|
||||||
|
# TEST #5: (NEGATIVE) catch eval in a prereq list trying to create new
|
||||||
|
# target/prereq relationships.
|
||||||
|
|
||||||
|
run_make_test('
|
||||||
|
.SECONDEXPANSION:
|
||||||
|
proj1.exe : proj1.o $$(eval $$(test))
|
||||||
|
define test
|
||||||
|
proj1.o : proj1.c
|
||||||
|
proj1.c: proj1.h
|
||||||
|
endef
|
||||||
|
',
|
||||||
|
'', "#MAKE#: *** prerequisites cannot be defined in recipes. Stop.\n", 512);
|
||||||
|
|
||||||
# This tells the test driver that the perl test script executed properly.
|
# This tells the test driver that the perl test script executed properly.
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user