# [PATCH] Makefile: fix MAKEFLAGS tests with multiple flags

1 messages from 2015-09-05 to 2015-09-05. Participants: John Keeping.
Thread: https://gitlist.dev/t/40281

## John Keeping, 2015-09-05 12:22

Subject: [PATCH] Makefile: fix MAKEFLAGS tests with multiple flags
Message-ID: <5c25f77717582a8f38a089da343b4cd2d6af345d.1441455709.git.john@keeping.me.uk>
URL: https://gitlist.dev/e/5c25f77717582a8f38a089da343b4cd2d6af345d.1441455709.git.john%40keeping.me.uk

```
findstring is defined as $(findstring FIND,IN) so if multiple flags are
set these tests do the wrong thing unless $(MAKEFLAGS) is the second
argument.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 34101e2..a556be6 100644
--- a/Makefile
+++ b/Makefile
@@ -1463,13 +1463,13 @@ endif
 QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
 QUIET_SUBDIR1  =
 
-ifneq ($(findstring $(MAKEFLAGS),w),w)
+ifneq ($(findstring w,$(MAKEFLAGS)),w)
 PRINT_DIR = --no-print-directory
 else # "make -w"
 NO_SUBDIR = :
 endif
 
-ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifneq ($(findstring s,$(MAKEFLAGS)),s)
 ifndef V
 	QUIET_CC       = @echo '   ' CC $@;
 	QUIET_AR       = @echo '   ' AR $@;
-- 
2.5.0.466.g9af26fa

```
