VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/options/dash-B@ 3208

最後變更 在這個檔案從3208是 3138,由 bird 提交於 7 年 前

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

  • 屬性 svn:eol-style 設為 LF
檔案大小: 1.7 KB
 
1# -*-perl-*-
2
3$description = "Test make -B (always remake) option.\n";
4
5$details = "\
6Construct a simple makefile that builds a target.
7Invoke make once, so it builds everything. Invoke it again and verify
8that nothing is built. Then invoke it with -B and verify that everything
9is built again.";
10
11&touch('bar.x');
12
13run_make_test('
14.SUFFIXES:
15
16.PHONY: all
17all: foo
18
19foo: bar.x
20 @echo cp $< $@
21 @echo "" > $@
22',
23 '', 'cp bar.x foo');
24
25run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'.");
26run_make_test(undef, '-B', 'cp bar.x foo');
27
28# Put the timestamp for foo into the future; it should still be remade.
29
30utouch(1000, 'foo');
31run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'.");
32run_make_test(undef, '-B', 'cp bar.x foo');
33
34# Clean up
35
36rmfiles('bar.x', 'foo');
37
38# Test -B with the re-exec feature: we don't want to re-exec forever
39# Savannah bug # 7566
40
41run_make_test('
42all: ; @:
43$(info MAKE_RESTARTS=$(MAKE_RESTARTS))
44include foo.x
45foo.x: ; @touch $@
46',
47 '-B', 'MAKE_RESTARTS=
48MAKE_RESTARTS=1');
49
50rmfiles('foo.x');
51
52# Test -B with the re-exec feature: we DO want -B in the "normal" part of the
53# makefile.
54
55&touch('blah.x');
56
57run_make_test('
58all: blah.x ; @echo $@
59$(info MAKE_RESTARTS=$(MAKE_RESTARTS))
60include foo.x
61foo.x: ; @touch $@
62blah.x: ; @echo $@
63',
64 '-B', 'MAKE_RESTARTS=
65MAKE_RESTARTS=1
66blah.x
67all');
68
69rmfiles('foo.x', 'blah.x');
70
71# Test that $? is set properly with -B; all prerequisites will be newer!
72
73utouch(-10, 'x.b');
74touch('x.a');
75
76run_make_test(q!
77x.a: x.b ; @echo $?
78!,
79 '-B', "x.b\n");
80
81unlink(qw(x.a x.b));
82
831;
84
85### Local Variables:
86### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
87### End:
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette