diff options
author | Ron Yorston <rmy@pobox.com> | 2024-04-21 10:58:52 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-04-21 11:05:12 +0100 |
commit | acda99ca9984570b03825c295a5617e67f0c1d7c (patch) | |
tree | e614f7774b03094330c854b95a8626a8d48a93a6 /testsuite/make.tests | |
parent | 90c5352a9746ee76d6219528e00ef5ef39d9dee4 (diff) | |
download | busybox-w32-acda99ca9984570b03825c295a5617e67f0c1d7c.tar.gz busybox-w32-acda99ca9984570b03825c295a5617e67f0c1d7c.tar.bz2 busybox-w32-acda99ca9984570b03825c295a5617e67f0c1d7c.zip |
make: allow mixed macros and targets on command line
POSIX requires macro definitions to appear before targets on the
command line. Allow mixed macros and targets as an extension.
All macros on the command line are read first, then the targets
are processed.
Costs 64-80 bytes.
(GitHub issue #406)
Diffstat (limited to '')
-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 c512fbdaa..546dca7d5 100755 --- a/testsuite/make.tests +++ b/testsuite/make.tests | |||
@@ -504,6 +504,17 @@ target: | |||
504 | @false; echo OK | 504 | @false; echo OK |
505 | ' | 505 | ' |
506 | 506 | ||
507 | # Macros and targets may be mixed on the command line | ||
508 | testing "make allow mixed macros and targets" \ | ||
509 | "make -f - FOO=foo foo BAR=bar bar" "foo\nbar\nfoo\nbar\n" "" ' | ||
510 | foo: | ||
511 | @echo $(FOO) | ||
512 | @echo $(BAR) | ||
513 | bar: | ||
514 | @echo $(FOO) | ||
515 | @echo $(BAR) | ||
516 | ' | ||
517 | |||
507 | # An empty original suffix indicates that every word should have | 518 | # An empty original suffix indicates that every word should have |
508 | # the new suffix added. If neither suffix is provided the words | 519 | # the new suffix added. If neither suffix is provided the words |
509 | # remain unchanged. | 520 | # remain unchanged. |