mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-02-05 14:07:46 +00:00
* tests/scripts/features/implicit_search: [SV 48643] Cleanups.
This commit is contained in:
parent
f485881d4a
commit
cbe0d2e47f
2 changed files with 15 additions and 21 deletions
18
NEWS
18
NEWS
|
@ -61,6 +61,15 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||||
avoiding the need for heuristics.
|
avoiding the need for heuristics.
|
||||||
Implementation provided by Sven C. Dack <sdack@gmx.com>
|
Implementation provided by Sven C. Dack <sdack@gmx.com>
|
||||||
|
|
||||||
|
* GNU make has sometimes chosen unexpected, and sub-optimal, chains of
|
||||||
|
implicit rules due to the definition of "ought to exist" in the implicit
|
||||||
|
rule search algorithm, which considered any prerequisite mentioned in the
|
||||||
|
makefile as "ought to exist". This algorithm has been modified to prefer
|
||||||
|
prerequisites mentioned explicitly in the target being built and only if
|
||||||
|
that results in no matching rule, will GNU make consider prerequisites
|
||||||
|
mentioned in other targets as "ought to exist".
|
||||||
|
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||||
|
|
||||||
* If the MAKEFLAGS variable is modified in a makefile, it will be re-parsed
|
* If the MAKEFLAGS variable is modified in a makefile, it will be re-parsed
|
||||||
immediately rather than after all makefiles have been read. Note that
|
immediately rather than after all makefiles have been read. Note that
|
||||||
although all options are parsed immediately, some special effects won't
|
although all options are parsed immediately, some special effects won't
|
||||||
|
@ -89,15 +98,6 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||||
made as a side-effect of some other target's recipe are now noticed as
|
made as a side-effect of some other target's recipe are now noticed as
|
||||||
expected.
|
expected.
|
||||||
|
|
||||||
* GNU make has sometimes chosen unexpected, and sub-optimal, chains of
|
|
||||||
implicit rules due to the definition of "ought to exist" in the implicit
|
|
||||||
rule search algorithm, which considered any prerequisite mentioned in the
|
|
||||||
makefile as "ought to exist". This algorithm has been modified to prefer
|
|
||||||
prerequisites mentioned explicitly in the target being built and only if
|
|
||||||
that results in no matching rule, will GNU make consider prerequisites
|
|
||||||
mentioned in other targets as "ought to exist".
|
|
||||||
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
|
||||||
|
|
||||||
* GNU Make can now be built for MS-Windows using the Tiny C tcc compiler.
|
* GNU Make can now be built for MS-Windows using the Tiny C tcc compiler.
|
||||||
Port provided by Christian Jullien <eligis@orange.fr>
|
Port provided by Christian Jullien <eligis@orange.fr>
|
||||||
|
|
||||||
|
|
|
@ -4,27 +4,21 @@ $description = "Test implicit rule search.";
|
||||||
|
|
||||||
$details = "";
|
$details = "";
|
||||||
|
|
||||||
|
|
||||||
# sv 48643
|
# sv 48643
|
||||||
# Each test has a %.c rule ahead of %.f rule.
|
# Each test has a %.c rule ahead of %.f rule.
|
||||||
# hello.f exists and hello.c is missing.
|
# hello.f exists and hello.c is missing.
|
||||||
|
|
||||||
unlink('hello.c', 'hello.tsk', 'hello.o', 'hello.x');
|
unlink('hello.c', 'hello.tsk', 'hello.o', 'hello.x');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Run every test with and without a suffix.
|
# Run every test with and without a suffix.
|
||||||
my @suffixes = ('', '.o');
|
my @suffixes = ('', '.o');
|
||||||
# Run every test with single and double colon rules.
|
# Run every test with single and double colon rules.
|
||||||
my @rules = ('', ':');
|
my @rules = ('', ':');
|
||||||
|
|
||||||
touch('hello.f');
|
|
||||||
|
|
||||||
for my $s (@suffixes) {
|
for my $s (@suffixes) {
|
||||||
for my $r (@rules) {
|
for my $r (@rules) {
|
||||||
touch('hello.f');
|
touch('hello.f');
|
||||||
|
|
||||||
|
|
||||||
# Test that make finds the intended implicit rule based on existence of a
|
# Test that make finds the intended implicit rule based on existence of a
|
||||||
# prerequisite in the filesystem.
|
# prerequisite in the filesystem.
|
||||||
#
|
#
|
||||||
|
@ -107,24 +101,24 @@ run_make_test("
|
||||||
all: hello$s
|
all: hello$s
|
||||||
%$s:$r %.c; \$(info \$<)
|
%$s:$r %.c; \$(info \$<)
|
||||||
%$s:$r %.f; \$(info \$<)
|
%$s:$r %.f; \$(info \$<)
|
||||||
.DEFAULT:; true
|
.DEFAULT:; \$(info \$\@) true
|
||||||
unrelated: hello.c
|
unrelated: hello.c
|
||||||
", '', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
|
", '', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
|
||||||
|
|
||||||
|
|
||||||
unlink('hello.f');
|
|
||||||
# hello.f is missing.
|
# hello.f is missing.
|
||||||
# This time both hello.c and hello.f are missing and both '%: %.c' and '%: %.f'
|
# This time both hello.c and hello.f are missing and both '%: %.c' and '%: %.f'
|
||||||
# require an intermediate.
|
# require an intermediate.
|
||||||
# The default rule builds intemerdiate hello.c.
|
# The default rule builds intemerdiate hello.c.
|
||||||
# '%: %.c' rule is chosen to build hello.
|
# '%: %.c' rule is chosen to build hello.
|
||||||
|
unlink('hello.f');
|
||||||
run_make_test("
|
run_make_test("
|
||||||
all: hello$s
|
all: hello$s
|
||||||
%$s:$r %.c; \$(info \$<)
|
%$s:$r %.c; \$(info \$<)
|
||||||
%$s:$r %.f; \$(info \$<)
|
%$s:$r %.f; \$(info \$<)
|
||||||
.DEFAULT:; false
|
.DEFAULT:; \$(info \$\@) false
|
||||||
unrelated: hello.c
|
unrelated: hello.c
|
||||||
", '', "false\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
|
", '', "hello.c\nfalse\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
|
||||||
|
|
||||||
# hello.f is missing.
|
# hello.f is missing.
|
||||||
# No rule is found, because hello.c is not mentioned explicitly.
|
# No rule is found, because hello.c is not mentioned explicitly.
|
||||||
|
@ -132,10 +126,10 @@ run_make_test("
|
||||||
all: hello$s
|
all: hello$s
|
||||||
%$s:$r %.c; \$(info \$<)
|
%$s:$r %.c; \$(info \$<)
|
||||||
%$s:$r %.f; \$(info \$<)
|
%$s:$r %.f; \$(info \$<)
|
||||||
.DEFAULT:; \@echo default making \$\@ && false
|
.DEFAULT:; \@\$(info \$\@) false
|
||||||
",
|
",
|
||||||
'',
|
'',
|
||||||
"default making hello$s\n#MAKE#: *** [#MAKEFILE#:5: hello$s] Error 1\n",
|
"hello$s\n#MAKE#: *** [#MAKEFILE#:5: hello$s] Error 1\n",
|
||||||
512);
|
512);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue