diff options
author | Ron Yorston <rmy@pobox.com> | 2022-10-18 15:00:36 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-10-18 15:00:36 +0100 |
commit | 92a127e9f96598b86a4327b70783b9769eaa94fe (patch) | |
tree | 16405c528c5d5712fc1784dfdb5477567592d201 /testsuite | |
parent | b749a2c0eb47b648805500c23ffbe4550e976a57 (diff) | |
download | busybox-w32-92a127e9f96598b86a4327b70783b9769eaa94fe.tar.gz busybox-w32-92a127e9f96598b86a4327b70783b9769eaa94fe.tar.bz2 busybox-w32-92a127e9f96598b86a4327b70783b9769eaa94fe.zip |
make: support $+ and $^ as POSIX 202X features
Austin Group defect reports 514 and 1520 have both been accepted.
Together these introduce the internal macros $+ and $^:
- $+ lists all prerequisites, with duplicates retained;
- $^ lists all prerequisites, with duplicates removed.
$^ had already been implemented as a non-POSIX extension, it now
becomes a POSIX 202X extension. $+ has been added as a POSIX
202X extension.
Neither of the above defect reports mentions how $? should handle
duplicate prerequisites. In POSIX mode duplicates are retained.
Removal of duplicates is implemented as a non-POSIX extension to
match existing practice in other versions of make.
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/make.tests | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests index 3d0d14dd0..67617f8a2 100755 --- a/testsuite/make.tests +++ b/testsuite/make.tests | |||
@@ -255,6 +255,18 @@ mk: | |||
255 | -include mk | 255 | -include mk |
256 | ' | 256 | ' |
257 | 257 | ||
258 | # $^ skips duplicate prerequisites, $+ doesn't | ||
259 | mkdir make.tempdir && cd make.tempdir || exit 1 | ||
260 | touch file1 file2 file3 | ||
261 | testing "make skip duplicate entries in \$^ but not \$+" \ | ||
262 | "make -f -" \ | ||
263 | "file1 file2 file3\nfile1 file2 file2 file3 file3\n" "" ' | ||
264 | target: file1 file2 file2 file3 file3 | ||
265 | @echo $^ | ||
266 | @echo $+ | ||
267 | ' | ||
268 | cd .. || exit 1; rm -rf make.tempdir 2>/dev/null | ||
269 | |||
258 | # Nested macro expansion is allowed. This should be compatible | 270 | # Nested macro expansion is allowed. This should be compatible |
259 | # with other implementations. | 271 | # with other implementations. |
260 | testing "make nested macro expansion" \ | 272 | testing "make nested macro expansion" \ |