mirror of
https://github.com/mirror/make.git
synced 2026-08-13 17:07:13 +00:00
Fix for complex situations where directories are declared as prerequisites.
Info on this fix from barkalow@reputation.com: thanks! Some updates/cleanups of some of the tests; added a forgotten -t test, etc.
This commit is contained in:
@@ -18,7 +18,6 @@ all: ; \@echo 'running rules.'
|
||||
|
||||
$makefile $makefile2: $makefile_orig
|
||||
\@echo 'rebuilding \$\@.'
|
||||
\@sleep $wtime
|
||||
\@echo >> \$\@
|
||||
|
||||
include $makefile2
|
||||
@@ -27,13 +26,8 @@ EOM
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch($makefile2);
|
||||
|
||||
# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
|
||||
# granularity of file times.
|
||||
sleep($wtime);
|
||||
|
||||
&touch("$makefile_orig");
|
||||
&utouch(-10, $makefile, $makefile2);
|
||||
&touch($makefile_orig);
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile, 0);
|
||||
|
||||
@@ -66,9 +60,8 @@ EOM
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch('b');
|
||||
&touch('a');
|
||||
sleep($wtime);
|
||||
&utouch(-20, 'b','a');
|
||||
#&utouch(-10, 'a');
|
||||
&touch('c');
|
||||
|
||||
# First try with the file that's not updated "once removed" from the
|
||||
|
||||
@@ -38,12 +38,14 @@ close(MAKEFILE);
|
||||
|
||||
@touchedfiles = ();
|
||||
|
||||
$off = -500;
|
||||
|
||||
sub touchfiles {
|
||||
foreach (@_) {
|
||||
($f = $_) =~ s,VP/,$VP,g;
|
||||
&touch($f);
|
||||
&utouch($off, $f);
|
||||
$off += 10;
|
||||
push(@touchedfiles, $f);
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,18 +55,19 @@ close(MAKEFILE);
|
||||
|
||||
@touchedfiles = ();
|
||||
|
||||
$off = -500;
|
||||
|
||||
sub touchfiles {
|
||||
foreach (@_) {
|
||||
sleep($wtime);
|
||||
($f = $_) =~ s,VP/,$VP,g;
|
||||
&touch($f);
|
||||
push(@touchedfiles, $f);
|
||||
&utouch($off, $_);
|
||||
$off += 10;
|
||||
push(@touchedfiles, $_);
|
||||
}
|
||||
}
|
||||
|
||||
# Run the general-case test
|
||||
|
||||
&touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
|
||||
&touchfiles("$VP/foo.d", "$VP/bar.d", "$VP/foo.c", "$VP/bar.c", "foo.b", "bar.d");
|
||||
|
||||
&run_make_with_options($makefile,"general",&get_logfile);
|
||||
|
||||
@@ -79,7 +80,7 @@ cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
|
||||
|
||||
# Test rules that don't make the target correctly
|
||||
|
||||
&touchfiles("VP/notarget.c", "notarget.b", "notarget.d");
|
||||
&touchfiles("$VP/notarget.c", "notarget.b", "notarget.d");
|
||||
|
||||
&run_make_with_options($makefile,"notarget",&get_logfile,512);
|
||||
|
||||
@@ -92,7 +93,7 @@ $make_name: *** [notarget.b] Error 1
|
||||
|
||||
# Test intermediate file handling (part 1)
|
||||
|
||||
&touchfiles("VP/inter.d");
|
||||
&touchfiles("$VP/inter.d");
|
||||
|
||||
&run_make_with_options($makefile,"intermediate",&get_logfile);
|
||||
|
||||
@@ -107,7 +108,11 @@ rm inter.b inter.c
|
||||
|
||||
# Test intermediate file handling (part 2)
|
||||
|
||||
&touchfiles("VP/inter.b", "VP/inter.d");
|
||||
&utouch(-20, "inter.a");
|
||||
&utouch(-10, "$VP/inter.b");
|
||||
&touch("$VP/inter.d");
|
||||
|
||||
push(@touchedfiles, "$VP/inter.b", "$VP/inter.d");
|
||||
|
||||
&run_make_with_options($makefile,"intermediate",&get_logfile);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user