2002-08-08 00:11:19 +00:00
|
|
|
# -*-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.";
|
|
|
|
|
2005-02-28 09:41:25 +00:00
|
|
|
&touch('bar.x');
|
2002-08-08 00:11:19 +00:00
|
|
|
|
2005-02-28 09:41:25 +00:00
|
|
|
run_make_test('
|
2002-08-08 00:11:19 +00:00
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: foo
|
|
|
|
|
|
|
|
foo: bar.x
|
|
|
|
@echo cp $< $@
|
2002-09-10 22:23:20 +00:00
|
|
|
@echo "" > $@
|
2005-02-28 09:41:25 +00:00
|
|
|
',
|
|
|
|
'', 'cp bar.x foo');
|
2002-08-08 00:11:19 +00:00
|
|
|
|
2005-02-28 09:41:25 +00:00
|
|
|
run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");
|
|
|
|
run_make_test(undef, '-B', 'cp bar.x foo');
|
2002-08-08 00:11:19 +00:00
|
|
|
|
2005-02-28 09:41:25 +00:00
|
|
|
# Put the timestamp for foo into the future; it should still be remade.
|
2002-08-08 00:11:19 +00:00
|
|
|
|
2005-02-28 09:41:25 +00:00
|
|
|
utouch(1000, 'foo');
|
|
|
|
run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");
|
|
|
|
run_make_test(undef, '-B', 'cp bar.x foo');
|
2002-08-08 00:11:19 +00:00
|
|
|
|
|
|
|
|
2005-02-28 09:41:25 +00:00
|
|
|
# Clean up
|
2002-08-08 00:11:19 +00:00
|
|
|
|
2005-02-28 09:41:25 +00:00
|
|
|
rmfiles('bar.x', 'foo');
|
2002-08-08 00:11:19 +00:00
|
|
|
|
|
|
|
1;
|