make/tests/scripts
Dmitry Goncharov 668eda0527 [SV 62206] Fix %-substitution in second expansion of pattern rules
During second expansion of pattern rules only the first pattern in
each "group" was being substituted.  E.g. in this makefile:

  .SECONDEXPANSION:
  all: hello.x
  %.x: $$(wordlist 1, 99, %.1 %.%.2) ; $(info $@ from $^)
  hello.1 hello.\%.2 \%.1 \%.\%.2: ;

the output would build "hello.1" and "%.%.2" because each function
is considered a single "word" and only the first pattern is replaced.

Fix the expansion so each whitespace-separated string is considered a
word and the first pattern is replaced, giving "hello.1" and
"hello.%.2".

* src/rule.c (snap_implicit_rules): Keep enough space to replace %
with $(*F) if necessary.
* src/implicit.c (pattern_search): During second expansion break each
get_next_word result into individual words and replace the first % in
each with $* or $(*F) as needed.
* tests/scripts/features/patternrules: Add tests for variations.
2022-04-24 17:52:07 -04:00
..
features [SV 62206] Fix %-substitution in second expansion of pattern rules 2022-04-24 17:52:07 -04:00
functions Don't write $(shell ...) stdout to stderr on failure 2022-02-06 18:46:32 -05:00
misc tests: Allow run_make_test() to avoid passing -f 2022-02-27 17:47:42 -05:00
options * tests/scripts/options/dash-f: [SV 62118] Close STDIN 2022-04-24 13:48:03 -04:00
targets Remove extraneous characters from fatal() calls 2022-02-27 18:01:13 -05:00
variables [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
vms Refresh the test suite framework implementation. 2019-09-16 08:25:33 -04:00
test_template Update the test template. A few fixes in run_make_test(). 2004-09-22 04:36:17 +00:00