boards: Move HOSTCC/HOSTCFLAGS to tools/Config.mk

Make.defs under board folder can still overwrite the default as needed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1c300a8ace4b54d475ef8d398661ed65ca273a2e
This commit is contained in:
Xiang Xiao
2020-07-12 23:07:42 +08:00
committed by Abdelatif Guettouche
parent 11a8c3e035
commit ee875b2a26
241 changed files with 28 additions and 978 deletions
+28
View File
@@ -74,6 +74,34 @@ MODULECC ?= $(CC)
MODULELD ?= $(LD)
MODULESTRIP ?= $(STRIP)
# Define HOSTCC on the make command line if it differs from these defaults
# Define HOSTCFLAGS with -g on the make command line to build debug versions
HOSTOS = ${shell uname -o 2>/dev/null || uname -s 2>/dev/null || echo "Other"}
ifeq ($(HOSTOS),MinGW)
# In the Windows native environment, the MinGW GCC compiler is used
HOSTCC ?= mingw32-gcc.exe
HOSTCFLAGS ?= -O2 -Wall -Wstrict-prototypes -Wshadow -DCONFIG_WINDOWS_NATIVE=y
else
# GCC or clang is assumed in all other POSIX environments
# (Linux, Cygwin, MSYS2, macOS).
# strtok_r is used in some tools, but does not seem to be available in
# the MinGW environment.
HOSTCC ?= cc
HOSTCFLAGS ?= -O2 -Wall -Wstrict-prototypes -Wshadow
HOSTCFLAGS += -DHAVE_STRTOK_C=1
ifeq ($(HOSTOS),Cygwin)
HOSTCFLAGS += -DHOST_CYGWIN=1
endif
endif
# Some defaults just to prohibit some bad behavior if for some reason they
# are not defined