2 $description = "Test pattern-specific variable settings.";
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
16 thr% : override BAZ = three
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)
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));