2013-02-16 17:32:19 +01:00
|
|
|
############################################################################
|
|
|
|
# arch/arm/src/armv6-m/Toolchain.defs
|
|
|
|
#
|
2017-01-01 23:29:03 +01:00
|
|
|
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
2013-02-16 17:32:19 +01:00
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
# Setup for the selected toolchain
|
|
|
|
|
|
|
|
#
|
|
|
|
# Handle old-style chip-specific toolchain names in the absence of
|
|
|
|
# a new-style toolchain specification, force the selection of a single
|
|
|
|
# toolchain and allow the selected toolchain to be overridden by a
|
|
|
|
# command-line selection.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_ATOLLIC)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= ATOLLIC
|
|
|
|
endif
|
2013-06-13 19:04:18 +02:00
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_BUILDROOT)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= BUILDROOT
|
|
|
|
endif
|
2013-06-13 19:04:18 +02:00
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_CODEREDL)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= CODEREDL
|
|
|
|
endif
|
2013-06-13 19:04:18 +02:00
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_CODEREDW)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= CODEREDW
|
|
|
|
endif
|
2013-06-13 19:04:18 +02:00
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_CODESOURCERYL)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= CODESOURCERYL
|
|
|
|
endif
|
2013-06-13 19:04:18 +02:00
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_CODESOURCERYW)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= CODESOURCERYW
|
|
|
|
endif
|
2013-06-13 19:04:18 +02:00
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_DEVKITARM)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= DEVKITARM
|
|
|
|
endif
|
2013-06-13 19:04:18 +02:00
|
|
|
|
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_GNU_EABIL)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= GNU_EABIL
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(filter y, $(CONFIG_ARMV6M_TOOLCHAIN_GNU_EABIW)),y)
|
|
|
|
CONFIG_ARMV6M_TOOLCHAIN ?= GNU_EABIW
|
2013-02-16 17:32:19 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Supported toolchains
|
|
|
|
#
|
|
|
|
# TODO - It's likely that all of these toolchains now support the
|
|
|
|
# CortexM0. Since they are all GCC-based, we could almost
|
|
|
|
# certainly simplify this further.
|
|
|
|
#
|
|
|
|
# Each toolchain definition should set:
|
|
|
|
#
|
|
|
|
# CROSSDEV The GNU toolchain triple (command prefix)
|
2013-06-13 19:04:18 +02:00
|
|
|
# ARCROSSDEV If required, an alternative prefix used when
|
2013-02-16 17:32:19 +01:00
|
|
|
# invoking ar and nm.
|
|
|
|
# ARCHCPUFLAGS CPU-specific flags selecting the instruction set
|
|
|
|
# options, etc.
|
|
|
|
# MAXOPTIMIZATION The maximum optimization level that results in
|
|
|
|
# reliable code generation.
|
|
|
|
#
|
|
|
|
|
2014-01-24 14:45:35 +01:00
|
|
|
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
|
|
|
|
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
|
|
|
|
endif
|
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
# Atollic toolchain under Windows
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),ATOLLIC)
|
|
|
|
CROSSDEV ?= arm-atollic-eabi-
|
|
|
|
ARCROSSDEV ?= arm-atollic-eabi-
|
2016-01-09 23:34:33 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
|
2013-02-16 17:32:19 +01:00
|
|
|
WINTOOL = y
|
|
|
|
endif
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-02-16 17:32:19 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# NuttX buildroot under Linux or Cygwin
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),BUILDROOT)
|
|
|
|
CROSSDEV ?= arm-nuttx-eabi-
|
|
|
|
ARCROSSDEV ?= arm-nuttx-eabi-
|
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Code Red RedSuite under Linux
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),CODEREDL)
|
|
|
|
CROSSDEV ?= arm-none-eabi-
|
|
|
|
ARCROSSDEV ?= arm-none-eabi-
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-02-16 17:32:19 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Code Red RedSuite under Windows
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),CODEREDW)
|
|
|
|
CROSSDEV ?= arm-none-eabi-
|
|
|
|
ARCROSSDEV ?= arm-none-eabi-
|
2016-01-09 23:34:33 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
|
2013-02-16 17:32:19 +01:00
|
|
|
WINTOOL = y
|
|
|
|
endif
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-02-16 17:32:19 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# CodeSourcery under Linux
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),CODESOURCERYL)
|
|
|
|
CROSSDEV ?= arm-none-eabi-
|
|
|
|
ARCROSSDEV ?= arm-none-eabi-
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-02-16 17:32:19 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# CodeSourcery under Windows
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),CODESOURCERYW)
|
|
|
|
CROSSDEV ?= arm-none-eabi-
|
|
|
|
ARCROSSDEV ?= arm-none-eabi-
|
2016-01-09 23:34:33 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
|
2013-02-16 17:32:19 +01:00
|
|
|
WINTOOL = y
|
|
|
|
endif
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-02-16 17:32:19 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# devkitARM under Windows
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),DEVKITARM)
|
|
|
|
CROSSDEV ?= arm-eabi-
|
|
|
|
ARCROSSDEV ?= arm-eabi-
|
2016-01-09 23:34:33 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
|
2013-02-16 17:32:19 +01:00
|
|
|
WINTOOL = y
|
|
|
|
endif
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-02-16 17:32:19 +01:00
|
|
|
endif
|
|
|
|
|
2020-04-26 04:44:18 +02:00
|
|
|
# Generic GNU EABI toolchain on macOS, Linux or any typical Posix system
|
2013-02-16 17:32:19 +01:00
|
|
|
|
2013-06-13 19:04:18 +02:00
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),GNU_EABIL)
|
2013-02-16 17:32:19 +01:00
|
|
|
CROSSDEV ?= arm-none-eabi-
|
|
|
|
ARCROSSDEV ?= arm-none-eabi-
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-06-13 19:04:18 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),GNU_EABIW)
|
|
|
|
CROSSDEV ?= arm-none-eabi-
|
|
|
|
ARCROSSDEV ?= arm-none-eabi-
|
2016-01-09 23:34:33 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
|
2013-06-13 19:04:18 +02:00
|
|
|
WINTOOL = y
|
|
|
|
endif
|
2015-07-31 16:39:26 +02:00
|
|
|
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
|
2013-06-13 19:04:18 +02:00
|
|
|
endif
|
2013-04-09 02:34:16 +02:00
|
|
|
|
|
|
|
# Individual tools may limit the optimizatin level but, by default, the
|
2019-09-29 20:52:20 +02:00
|
|
|
# optimization level will be set to -Os
|
2013-04-09 02:34:16 +02:00
|
|
|
|
|
|
|
MAXOPTIMIZATION ?= -Os
|