aboutsummaryrefslogtreecommitdiff
path: root/testsuite/make.tests
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-05-29 17:07:19 +0100
committerRon Yorston <rmy@pobox.com>2024-05-29 17:07:19 +0100
commit2a0923c400fe5df140e1c5aad8dc59f4733e8598 (patch)
treebea94ec747825a054a5f9d080bf241c1cbec62a1 /testsuite/make.tests
parente46cb57b07b4b2c54e8219a5035ee4dff8a20a4c (diff)
downloadbusybox-w32-2a0923c400fe5df140e1c5aad8dc59f4733e8598.tar.gz
busybox-w32-2a0923c400fe5df140e1c5aad8dc59f4733e8598.tar.bz2
busybox-w32-2a0923c400fe5df140e1c5aad8dc59f4733e8598.zip
make: allow :::= macro assignment on command line
GNU make and bmake have different implementations for := macro assignment. In POSIX 202X these are supported by the forms ::= and :::= respectively. Only the former was supported on the pdpmake command line. Add the required support in process_macros() and update the usage message. Adds 48-64 bytes.
Diffstat (limited to '')
-rwxr-xr-xtestsuite/make.tests24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests
index bac673178..0397ab4de 100755
--- a/testsuite/make.tests
+++ b/testsuite/make.tests
@@ -176,6 +176,30 @@ target:
176 @echo $(reset) 176 @echo $(reset)
177' 177'
178 178
179# Since GNU make and bmake interpret := macro assignments differently,
180# POSIX has ::= for the GNU variant and :::= for BSD.
181testing "make different styles of := macro assignment" \
182 "make -f -" \
183 '65 a a $A\n' "" '
184A = a
185GNU ::= $A
186BSD1 :::= $A
187BSD2 :::= $$A
188A = 65
189
190target:
191 @echo '\''$(A) $(GNU) $(BSD1) $(BSD2)'\''
192'
193
194# Similar to the above but for macro assignments on the command line.
195# POSIX has ::= for the GNU variant and :::= for BSD.
196testing "make := macro assignment on command line" \
197 "make -f - A=a 'GNU::=\$A' 'BSD1:::=\$A' 'BSD2:::=\$\$A' A=65" \
198 '65 a a $A\n' "" '
199target:
200 @echo '\''$(A) $(GNU) $(BSD1) $(BSD2)'\''
201'
202
179# basic pattern macro expansion 203# basic pattern macro expansion
180testing "make basic pattern macro expansion" \ 204testing "make basic pattern macro expansion" \
181 "make -f -" \ 205 "make -f -" \