[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/7] Makefile: ignore long options
From: |
Paolo Bonzini |
Subject: |
[PULL 2/7] Makefile: ignore long options |
Date: |
Thu, 29 Jul 2021 14:47:08 +0200 |
From: Alexey Neyman <stilor@att.net>
When searching for options like -n in MAKEFLAGS, current code may result
in a false positive match when make is invoked with long options like
--no-print-directory. This has been observed with certain versions of
host make (e.g. 3.82) while building the Qemu package in buildroot.
Filter out such long options before searching for one-character options.
Signed-off-by: Alexey Neyman <stilor@att.net>
Message-Id: <20210722020846.3678817-1-stilor@att.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 6c36330eef..401c623a65 100644
--- a/Makefile
+++ b/Makefile
@@ -129,9 +129,11 @@ endif
# 4. Rules to bridge to other makefiles
ifneq ($(NINJA),)
-MAKE.n = $(findstring n,$(firstword $(MAKEFLAGS)))
-MAKE.k = $(findstring k,$(firstword $(MAKEFLAGS)))
-MAKE.q = $(findstring q,$(firstword $(MAKEFLAGS)))
+# Filter out long options to avoid flags like --no-print-directory which
+# may result in false positive match for MAKE.n
+MAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS))))
+MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
+MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
$(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \
--
2.31.1
- [PULL 0/7] Misc patches for QEMU 6.1-rc2, Paolo Bonzini, 2021/07/29
- [PULL 1/7] i386: assert 'cs->kvm_state' is not null, Paolo Bonzini, 2021/07/29
- [PULL 2/7] Makefile: ignore long options,
Paolo Bonzini <=
- [PULL 3/7] configure: Add -Werror to avx2, avx512 tests, Paolo Bonzini, 2021/07/29
- [PULL 4/7] target/i386: Added consistency checks for event injection, Paolo Bonzini, 2021/07/29
- [PULL 5/7] target/i386: fix typo in ctl_has_irq, Paolo Bonzini, 2021/07/29
- [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject, Paolo Bonzini, 2021/07/29
[PULL 7/7] libvhost-user: fix -Werror=format= warnings with __u64 fields, Paolo Bonzini, 2021/07/29
Re: [PULL 0/7] Misc patches for QEMU 6.1-rc2, Peter Maydell, 2021/07/29