mirror of
https://github.com/mirror/make.git
synced 2025-02-04 16:51:12 +08:00
Fixed Savannah bug #12267.
This commit is contained in:
parent
18251c4633
commit
d584d0c1c6
@ -1,3 +1,9 @@
|
|||||||
|
2005-03-10 Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
|
* implicit.c (pattern_search): Mark an intermediate target as
|
||||||
|
precious if it happened to be a prerequisite of some (other)
|
||||||
|
target. Fixes Savannah bug #12267.
|
||||||
|
|
||||||
2005-03-09 Boris Kolpackov <boris@kolpackov.net>
|
2005-03-09 Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
* main.c (main): Use o_file instead of o_default when defining
|
* main.c (main): Use o_file instead of o_default when defining
|
||||||
|
16
implicit.c
16
implicit.c
@ -798,15 +798,29 @@ pattern_search (struct file *file, int archive,
|
|||||||
of F below are null before we change them. */
|
of F below are null before we change them. */
|
||||||
|
|
||||||
struct file *imf = d->intermediate_file;
|
struct file *imf = d->intermediate_file;
|
||||||
register struct file *f = enter_file (imf->name);
|
register struct file *f = lookup_file (imf->name);
|
||||||
|
|
||||||
|
/* We don't want to delete an intermediate file that happened
|
||||||
|
to be a prerequisite of some (other) target. Mark it as
|
||||||
|
precious. */
|
||||||
|
if (f != 0)
|
||||||
|
f->precious = 1;
|
||||||
|
else
|
||||||
|
f = enter_file (imf->name);
|
||||||
|
|
||||||
f->deps = imf->deps;
|
f->deps = imf->deps;
|
||||||
f->cmds = imf->cmds;
|
f->cmds = imf->cmds;
|
||||||
f->stem = imf->stem;
|
f->stem = imf->stem;
|
||||||
f->also_make = imf->also_make;
|
f->also_make = imf->also_make;
|
||||||
f->is_target = 1;
|
f->is_target = 1;
|
||||||
|
|
||||||
|
if (!f->precious)
|
||||||
|
{
|
||||||
imf = lookup_file (d->intermediate_pattern);
|
imf = lookup_file (d->intermediate_pattern);
|
||||||
if (imf != 0 && imf->precious)
|
if (imf != 0 && imf->precious)
|
||||||
f->precious = 1;
|
f->precious = 1;
|
||||||
|
}
|
||||||
|
|
||||||
f->intermediate = 1;
|
f->intermediate = 1;
|
||||||
f->tried_implicit = 1;
|
f->tried_implicit = 1;
|
||||||
for (dep = f->deps; dep != 0; dep = dep->next)
|
for (dep = f->deps; dep != 0; dep = dep->next)
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2005-03-10 Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
|
* scripts/features/patternrules: Add a test for Savannah bug #12267.
|
||||||
|
|
||||||
2005-03-09 Boris Kolpackov <boris@kolpackov.net>
|
2005-03-09 Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
* scripts/variables/DEFAULT_TARGET: Add a test for Savannah
|
* scripts/variables/DEFAULT_TARGET: Add a test for Savannah
|
||||||
|
@ -4,6 +4,12 @@ $description = "Test pattern rules.";
|
|||||||
|
|
||||||
$details = "";
|
$details = "";
|
||||||
|
|
||||||
|
use Cwd;
|
||||||
|
|
||||||
|
$dir = cwd;
|
||||||
|
$dir =~ s,.*/([^/]+)$,../$1,;
|
||||||
|
|
||||||
|
|
||||||
# TEST #1: Make sure that multiple patterns where the same target
|
# TEST #1: Make sure that multiple patterns where the same target
|
||||||
# can be built are searched even if the first one fails
|
# can be built are searched even if the first one fails
|
||||||
# to match properly.
|
# to match properly.
|
||||||
@ -63,5 +69,31 @@ foo.in: ; @:
|
|||||||
foo.out');
|
foo.out');
|
||||||
|
|
||||||
|
|
||||||
|
# TEST #3: make sure intermidite files that also happened to be
|
||||||
|
# prerequisites are not removed (Savannah bug #12267).
|
||||||
|
#
|
||||||
|
run_make_test('
|
||||||
|
$(dir)/foo.o:
|
||||||
|
|
||||||
|
$(dir)/foo.y:
|
||||||
|
@echo $@
|
||||||
|
|
||||||
|
%.c: %.y
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
@echo $@
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install: $(dir)/foo.c
|
||||||
|
|
||||||
|
',
|
||||||
|
"dir=$dir",
|
||||||
|
"$dir/foo.y
|
||||||
|
touch $dir/foo.c
|
||||||
|
$dir/foo.o");
|
||||||
|
|
||||||
|
unlink("$dir/foo.c");
|
||||||
|
|
||||||
# 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