mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-12-28 15:57:48 +00:00
bc91c0b23f
* Never use "touch" in make rules; it breaks on most sub-second supporting systems. Use echo "" > $@ instead. * Forgot to close test makefiles before using them! All the above worked fine on Linux but failed miserably on Solaris.
43 lines
987 B
Perl
43 lines
987 B
Perl
# -*-perl-*-
|
|
|
|
$description = "Test make -B (always remake) option.\n";
|
|
|
|
$details = "\
|
|
Construct a simple makefile that builds a target.
|
|
Invoke make once, so it builds everything. Invoke it again and verify
|
|
that nothing is built. Then invoke it with -B and verify that everything
|
|
is built again.";
|
|
|
|
open(MAKEFILE,"> $makefile");
|
|
|
|
print MAKEFILE <<'EOF';
|
|
.SUFFIXES:
|
|
|
|
.PHONY: all
|
|
all: foo
|
|
|
|
foo: bar.x
|
|
@echo cp $< $@
|
|
@echo "" > $@
|
|
EOF
|
|
|
|
close(MAKEFILE);
|
|
|
|
|
|
&touch('bar.x');
|
|
|
|
&run_make_with_options($makefile, '', &get_logfile);
|
|
$answer = "cp bar.x foo\n";
|
|
&compare_output($answer, &get_logfile(1));
|
|
|
|
&run_make_with_options($makefile, '', &get_logfile);
|
|
$answer = "$make_name: Nothing to be done for `all'.\n";
|
|
&compare_output($answer, &get_logfile(1));
|
|
|
|
&run_make_with_options($makefile, '-B', &get_logfile);
|
|
$answer = "cp bar.x foo\n";
|
|
&compare_output($answer, &get_logfile(1));
|
|
|
|
unlink('bar.x', 'foo') unless $keep;
|
|
|
|
1;
|