1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Makefile.include: move default TOOLCHAIN before global goals

This commit is contained in:
Francisco Molina 2021-01-21 18:30:48 +01:00
parent 7212ad7dbd
commit d1deb6f3ef
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8

View File

@ -173,6 +173,27 @@ include $(RIOTMAKE)/boards.inc.mk
# Debug targets for build system migration
include $(RIOTMAKE)/dependencies_debug.inc.mk
# Use TOOLCHAIN environment variable to select the toolchain to use.
# If native, TOOLCHAIN for OSX is llvm
ifeq ($(BOARD),native)
ifeq ($(OS),Darwin)
TOOLCHAIN ?= llvm
endif
endif
# Use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
ifeq (clang,$(TOOLCHAIN))
# TOOLCHAIN = clang is an alias for TOOLCHAIN = llvm
override TOOLCHAIN := llvm
endif
ifeq (gcc,$(TOOLCHAIN))
# TOOLCHAIN = gcc is an alias for TOOLCHAIN = gnu
override TOOLCHAIN := gnu
endif
ifeq (,$(TOOLCHAIN))
override TOOLCHAIN := gnu
endif
GLOBAL_GOALS += buildtest \
buildtest-indocker \
info-boards-features-blacklisted \
@ -320,33 +341,6 @@ ifeq (, $(APPLICATION))
$(error An application name must be specified as APPLICATION.)
endif
# Use TOOLCHAIN environment variable to select the toolchain to use.
# Default for macOS: llvm; for other OS: gnu
ifeq ($(BOARD),native)
ifeq ($(OS),Darwin)
TOOLCHAIN ?= llvm
endif
endif
TOOLCHAIN ?= gnu
# TOOLCHAIN = clang is an alias for TOOLCHAIN = llvm
ifeq (clang,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override TOOLCHAIN := llvm
endif
# TOOLCHAIN = gcc is an alias for TOOLCHAIN = gnu
ifeq (gcc,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override TOOLCHAIN := gnu
endif
ifeq (,$(TOOLCHAIN))
override TOOLCHAIN := gnu
endif
# default toolchain prefix, defaults to target triple followed by a dash, you
# will most likely not need to touch this.
export PREFIX ?= $(if $(TARGET_ARCH),$(TARGET_ARCH)-)