3 $description = "Test various flavors of make variable setting.";
7 open(MAKEFILE, "> $makefile");
9 # The Contents of the MAKEFILE ...
11 print MAKEFILE <<'EOF';
16 all: multi ; @echo $(foo)
25 space := $(nullstring) $(nullstring)
27 next: ; @echo $x$(space)$y
48 outer: ; @echo $(inner)
52 # END of Contents of MAKEFILE
59 &run_make_with_options($makefile, "", &get_logfile);
60 $answer = "hi\necho there\nthere\nHello\n";
61 &compare_output($answer, &get_logfile(1));
66 &run_make_with_options($makefile, "next", &get_logfile);
67 $answer = "later foo bar\n";
68 &compare_output($answer, &get_logfile(1));
73 &run_make_with_options($makefile, "BOGUS=true", &get_logfile, 512);
74 $answer = "$makefile:24: *** empty variable name. Stop.\n";
75 &compare_output($answer, &get_logfile(1));
80 &run_make_with_options($makefile, "outer", &get_logfile);
82 &compare_output($answer, &get_logfile(1));
84 # Clean up from "old style" testing. If all the above tests are converted to
85 # run_make_test() syntax than this line can be removed.
88 # -------------------------
89 # Make sure that prefix characters apply properly to define/endef values.
91 # There's a bit of oddness here if you try to use a variable to hold the
92 # prefix character for a define. Even though something like this:
100 # (where V=@) can be seen by the user to be obviously different than this:
108 # and the user thinks it should behave the same as when the "@" is literal
109 # instead of in a variable, that can't happen because by the time make
110 # expands the variables for the command line and sees it begins with a "@" it
111 # can't know anymore whether the prefix character came before the variable
112 # reference or was included in the first line of the variable reference.
129 run_make_test(undef, 'V1=@ V2=@', 'hello
148 run_make_test(undef, 'V2=@', 'echo hello
155 run_make_test(undef, 'V1=@ V2=@', 'hello
160 # Test the basics; a "@" internally to the variable applies to only one line.
161 # A "@" before the variable applies to the entire variable.