Makefile: fix MAKEFLAGS tests with multiple flags
authorJohn Keeping <john@keeping.me.uk>
Sat, 5 Sep 2015 12:22:10 +0000 (13:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Sep 2015 16:26:23 +0000 (09:26 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
index bab75655635b17db80de05e04417c8e95fe70eb0..ef95ada06c1a09da9c71da83856e8d6a957e4b49 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -608,13 +608,13 @@ endif
 QUIET_SUBDIR0  = $(MAKE) -C # space to separate -C and subdir
 QUIET_SUBDIR1  =
 
 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
 
 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 $@;
 ifndef V
        QUIET_CC       = @echo '   ' CC $@;
        QUIET_AR       = @echo '   ' AR $@;