aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-10-23 16:17:12 +0100
committerRon Yorston <rmy@pobox.com>2023-10-23 16:17:12 +0100
commitd6b76411684d9cc7a676e98bd9f39daecfe8af36 (patch)
treeb3a916bdbad2b229b8714f79274d54c75dd8c929 /testsuite
parent87a3ddc0620fb3ff022663bf2241b92b483e3cf0 (diff)
downloadbusybox-w32-d6b76411684d9cc7a676e98bd9f39daecfe8af36.tar.gz
busybox-w32-d6b76411684d9cc7a676e98bd9f39daecfe8af36.tar.bz2
busybox-w32-d6b76411684d9cc7a676e98bd9f39daecfe8af36.zip
make: fix detection of target rules
The presence of an equal sign in an inline command on a target rule caused the line to be detected as a macro assignment. For example: target:; @echo a = $(a) Rearrange input parsing so target rules are detected before macro assignments. This is made more complex by having to allow for the ':=', '::=' and ':::=' assignment operators. (And for targets containing colons on Windows.) Costs 240-248 bytes.
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/make.tests8
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests
index 60bb78406..3c2aa5cf5 100755
--- a/testsuite/make.tests
+++ b/testsuite/make.tests
@@ -94,6 +94,14 @@ target:
94 @exit 42 94 @exit 42
95' 95'
96 96
97# An equal sign in a command on a target rule was detected as a
98# macro assignment.
99testing "make equal sign in inline command" \
100 "make -f -" "a = a\n" "" '
101a = a
102target:;@echo a = $(a)
103'
104
97# A macro created using ::= remembers it's of type immediate-expansion. 105# A macro created using ::= remembers it's of type immediate-expansion.
98# Immediate expansion also occurs when += is used to append to such a macro. 106# Immediate expansion also occurs when += is used to append to such a macro.
99testing "make appending to immediate-expansion macro" \ 107testing "make appending to immediate-expansion macro" \