diff options
author | Ron Yorston <rmy@pobox.com> | 2022-11-16 14:27:34 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-11-16 14:27:34 +0000 |
commit | 04e7f6dd0fc57ab98f39fb6fc9df610d0737ff17 (patch) | |
tree | 945247f2283a290c082b1292021e9fe87aae7d10 /testsuite | |
parent | f3f72ac1d2a56b97c6e90aa359ad236f528b5294 (diff) | |
download | busybox-w32-04e7f6dd0fc57ab98f39fb6fc9df610d0737ff17.tar.gz busybox-w32-04e7f6dd0fc57ab98f39fb6fc9df610d0737ff17.tar.bz2 busybox-w32-04e7f6dd0fc57ab98f39fb6fc9df610d0737ff17.zip |
make: changes to suffix substitution in macro expansion
The POSIX standard defines suffix substitution in macro expansion
as taking the form:
$(string1 [: subst1 =[ subst2 ]])
Since 'subst1' isn't bracketed a value must be supplied. Enforce
this in POSIX mode.
As a non-POSIX extension an empty 'subst1' is permitted with 'subst2'
being added to all words unconditionally. If both 'subst1' and
'subst2' are empty the words are returned unchanged.
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/make.tests | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests index 8a0f1a7d2..7749bed52 100755 --- a/testsuite/make.tests +++ b/testsuite/make.tests | |||
@@ -450,6 +450,17 @@ test.b: | |||
450 | ' | 450 | ' |
451 | cd .. || exit 1; rm -rf make.tempdir 2>/dev/null | 451 | cd .. || exit 1; rm -rf make.tempdir 2>/dev/null |
452 | 452 | ||
453 | # An empty original suffix indicates that every word should have | ||
454 | # the new suffix added. If neither suffix is provided the words | ||
455 | # remain unchanged. | ||
456 | testing "make macro expansion and suffix substitution 3" \ | ||
457 | "make -f -" "src1.c src2.c\nsrc1 src2\n" "" ' | ||
458 | SRCS = src1 src2 | ||
459 | target: | ||
460 | @echo $(SRCS:=.c) | ||
461 | @echo $(SRCS:=) | ||
462 | ' | ||
463 | |||
453 | # Skip duplicate entries in $? and $^ | 464 | # Skip duplicate entries in $? and $^ |
454 | mkdir make.tempdir && cd make.tempdir || exit 1 | 465 | mkdir make.tempdir && cd make.tempdir || exit 1 |
455 | touch -t 202206171200 file1 file3 | 466 | touch -t 202206171200 file1 file3 |