From 212933f0802bf482f048872356723f2a3ebc61e6 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 13 Jan 2023 11:44:06 +0100 Subject: [PATCH] toolchain/gnu.inc.mk: don't check version if CC is not installed With b30efeeb65 a warning was introduced when using `make term` without the proper toolchain installed (e.g. when using BUILD_IN_DOCKER, but `term` outside of the docker). This removes this warning --- makefiles/toolchain/gnu.inc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/toolchain/gnu.inc.mk b/makefiles/toolchain/gnu.inc.mk index 8c9785690bb4..e3e10485b5f2 100644 --- a/makefiles/toolchain/gnu.inc.mk +++ b/makefiles/toolchain/gnu.inc.mk @@ -23,7 +23,7 @@ endif _OBJDUMP := $(or $(shell command -v $(PREFIX)objdump || command -v gobjdump),objdump) OBJDUMP ?= $(_OBJDUMP) -GCC_VERSION := $(shell $(CC) -dumpversion | cut -d . -f 1) +GCC_VERSION := $(shell command -v $(CC) > /dev/null && $(CC) -dumpversion | cut -d . -f 1) # -fmacro-prefix-map requires GCC 8 ifneq (8, $(firstword $(shell echo 8 $(GCC_VERSION) | tr ' ' '\n' | sort -n)))