2 $description = "Test second expansion in ordinary rules.";
6 # TEST #0: Test handing of '$' in prerequisites with and without second
9 # If we don't support archives then the prerequisite is different
10 my $prereq = exists $FEATURES{'archives'} ? '$' : '$(PRE)';
16 foo$$bar: bar$$baz bar$$biz ; @echo '$@ : $^'
21 .DEFAULT: ; @echo '$@'
24 "$prereq\nbar\$biz\nfoo\$bar : bar\$baz bar\$biz");
26 run_make_test(undef, 'SE=1', "three\nfour\nbariz\nfoo\$bar : baraz bariz");
28 # TEST #1: automatic variables.
32 .DEFAULT: ; @echo '$@'
40 $$(addsuffix .3,$$^) \
41 $$(addsuffix .4,$$+) \
64 # Test #2: target/pattern -specific variables.
68 .DEFAULT: ; @echo '$@'
82 # Test #3: order of prerequisites.
86 .DEFAULT: ; @echo '$@'
116 # TEST #4: eval in a context where there is no reading_file
119 all : $$(eval $$(info test))
121 '', "test\n#MAKE#: Nothing to be done for 'all'.\n");
123 # TEST #5: (NEGATIVE) catch eval in a prereq list trying to create new
124 # target/prereq relationships.
128 proj1.exe : proj1.o $$(eval $$(test))
134 '', "#MAKE#: *** prerequisites cannot be defined in recipes. Stop.\n", 512);
137 # Automatic $$+ variable expansion issue. Savannah bug #25780
141 all : $$+ ; @echo '$+'
144 '', "foo foo foo foo\n");
147 # Automatic $$+ variable expansion issue. Savannah bug #25780
153 a%l: q1x $$+ q2x ; @echo '$+'
155 '', "q1x bar bar q2x bar bar\n");
158 # Allow patsubst shorthand in second expansion context.
159 # Requires the colon to be quoted. Savannah bug #16545
163 foo: $$(@\\:%=%.bar); @echo '$^'