diff options
author | Alexey Neyman | 2021-07-22 04:08:46 +0200 |
---|---|---|
committer | Paolo Bonzini | 2021-07-29 10:15:51 +0200 |
commit | 14833e24dea49303ebc2464813601054b6cdfcac (patch) | |
tree | a6370fbbf6fad71a08d76a84b0f2ff4410802c6f /Makefile | |
parent | i386: assert 'cs->kvm_state' is not null (diff) | |
download | qemu-14833e24dea49303ebc2464813601054b6cdfcac.tar.gz qemu-14833e24dea49303ebc2464813601054b6cdfcac.tar.xz qemu-14833e24dea49303ebc2464813601054b6cdfcac.zip |
Makefile: ignore long options
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>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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)))) \ |