diff options
author | Ron Yorston <rmy@pobox.com> | 2024-05-22 14:05:41 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-05-22 14:05:41 +0100 |
commit | 8248785e1d70b5365e2fc17e17dc2ba861c88dd1 (patch) | |
tree | faa2baed93842559bb5b3efd3bfb553c61627e9e /testsuite/make.tests | |
parent | c6b525f2afde0833d21b3f0132961a3b0178bbbb (diff) | |
download | busybox-w32-8248785e1d70b5365e2fc17e17dc2ba861c88dd1.tar.gz busybox-w32-8248785e1d70b5365e2fc17e17dc2ba861c88dd1.tar.bz2 busybox-w32-8248785e1d70b5365e2fc17e17dc2ba861c88dd1.zip |
make: add support for ifeq/ifneq
Add support for the conditional directives ifeq and ifneq.
These follow GNU make in allowing things like:
ifeq (arg1,arg2)
ifeq 'arg1' 'arg2'
In the second case single or double quotes may be used.
Macros are expanded in the two arguments and the resulting strings
are compared.
Adds 240-248 bytes.
Diffstat (limited to '')
-rwxr-xr-x | testsuite/make.tests | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests index 5119a77d3..ba3855973 100755 --- a/testsuite/make.tests +++ b/testsuite/make.tests | |||
@@ -553,6 +553,20 @@ src.o: src.c src.h | |||
553 | ' | 553 | ' |
554 | cd .. || exit 1; rm -rf make.tempdir 2>/dev/null | 554 | cd .. || exit 1; rm -rf make.tempdir 2>/dev/null |
555 | 555 | ||
556 | # ifeq/ifneq conditionals are supported | ||
557 | testing 'make support ifeq and ifneq conditionals' \ | ||
558 | "make -f -" "A OK\nB OK\n" "" ' | ||
559 | A = a | ||
560 | B = b | ||
561 | target: | ||
562 | ifeq ($(A),a) | ||
563 | @echo A OK | ||
564 | endif | ||
565 | ifneq "a" "$B" | ||
566 | @echo B OK | ||
567 | endif | ||
568 | ' | ||
569 | |||
556 | # An empty original suffix indicates that every word should have | 570 | # An empty original suffix indicates that every word should have |
557 | # the new suffix added. If neither suffix is provided the words | 571 | # the new suffix added. If neither suffix is provided the words |
558 | # remain unchanged. | 572 | # remain unchanged. |