No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gmake / tests / scripts / features / patspecific_vars
blob7feb68769a48613e13880580363550f3e84ff5de
1 #                                                                    -*-perl-*-
2 $description = "Test pattern-specific variable settings.";
4 $details = "\
5 Create a makefile containing various flavors of pattern-specific variable
6 settings, override and non-override, and using various variable expansion
7 rules, semicolon interference, etc.";
9 open(MAKEFILE,"> $makefile");
11 print MAKEFILE <<'EOF';
12 all: one.x two.x three.x
13 FOO = foo
14 BAR = bar
15 BAZ = baz
16 thr% : override BAZ = three
17 t%.x: BAR = four
18 %.x: BAR = two
19 %.x: override BAZ = three
20 one.x: override FOO = one
21 one.x two.x three.x: ; @echo $(FOO) $(BAR) $(BAZ)
22 four.x: baz ; @echo $(FOO) $(BAR) $(BAZ)
23 baz: ; @echo $(FOO) $(BAR) $(BAZ)
24 EOF
26 close(MAKEFILE);
29 # TEST #1 -- basics
31 &run_make_with_options($makefile, "", &get_logfile);
32 $answer = "one two three\nfoo four baz\nfoo bar three\n";
33 &compare_output($answer,&get_logfile(1));
36 # TEST #2 -- try the override feature
38 &run_make_with_options($makefile, "BAZ=five", &get_logfile);
39 $answer = "one two three\nfoo four five\nfoo bar three\n";
40 &compare_output($answer,&get_logfile(1));
43 # TEST #3 -- make sure patterns are inherited properly
45 &run_make_with_options($makefile, "four.x", &get_logfile);
46 $answer = "foo two three\nfoo two three\n";
47 &compare_output($answer,&get_logfile(1));