diff options
author | Ron Yorston <rmy@pobox.com> | 2024-05-29 17:07:19 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-05-29 17:07:19 +0100 |
commit | 2a0923c400fe5df140e1c5aad8dc59f4733e8598 (patch) | |
tree | bea94ec747825a054a5f9d080bf241c1cbec62a1 /testsuite/make.tests | |
parent | e46cb57b07b4b2c54e8219a5035ee4dff8a20a4c (diff) | |
download | busybox-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-x | testsuite/make.tests | 24 |
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. | ||
181 | testing "make different styles of := macro assignment" \ | ||
182 | "make -f -" \ | ||
183 | '65 a a $A\n' "" ' | ||
184 | A = a | ||
185 | GNU ::= $A | ||
186 | BSD1 :::= $A | ||
187 | BSD2 :::= $$A | ||
188 | A = 65 | ||
189 | |||
190 | target: | ||
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. | ||
196 | testing "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' "" ' | ||
199 | target: | ||
200 | @echo '\''$(A) $(GNU) $(BSD1) $(BSD2)'\'' | ||
201 | ' | ||
202 | |||
179 | # basic pattern macro expansion | 203 | # basic pattern macro expansion |
180 | testing "make basic pattern macro expansion" \ | 204 | testing "make basic pattern macro expansion" \ |
181 | "make -f -" \ | 205 | "make -f -" \ |