aboutsummaryrefslogtreecommitdiff
path: root/testsuite/make.tests
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-05-22 14:05:41 +0100
committerRon Yorston <rmy@pobox.com>2024-05-22 14:05:41 +0100
commit8248785e1d70b5365e2fc17e17dc2ba861c88dd1 (patch)
treefaa2baed93842559bb5b3efd3bfb553c61627e9e /testsuite/make.tests
parentc6b525f2afde0833d21b3f0132961a3b0178bbbb (diff)
downloadbusybox-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-xtestsuite/make.tests14
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'
554cd .. || exit 1; rm -rf make.tempdir 2>/dev/null 554cd .. || exit 1; rm -rf make.tempdir 2>/dev/null
555 555
556# ifeq/ifneq conditionals are supported
557testing 'make support ifeq and ifneq conditionals' \
558 "make -f -" "A OK\nB OK\n" "" '
559A = a
560B = b
561target:
562ifeq ($(A),a)
563 @echo A OK
564endif
565ifneq "a" "$B"
566 @echo B OK
567endif
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.