2020-06-10 18:54:14 +02:00
|
|
|
CC = $(PREFIX)gcc
|
|
|
|
CXX = $(PREFIX)g++
|
|
|
|
CCAS ?= $(CC)
|
2015-07-10 11:57:43 +02:00
|
|
|
ifeq ($(LTO),1)
|
2020-06-10 18:54:14 +02:00
|
|
|
AR = $(PREFIX)gcc-ar
|
|
|
|
RANLIB = $(PREFIX)gcc-ranlib
|
2015-07-10 11:57:43 +02:00
|
|
|
else
|
2020-06-10 18:54:14 +02:00
|
|
|
AR = $(PREFIX)ar
|
|
|
|
RANLIB = $(PREFIX)ranlib
|
2015-07-10 11:57:43 +02:00
|
|
|
endif
|
2020-06-10 18:54:14 +02:00
|
|
|
AS = $(PREFIX)as
|
|
|
|
NM = $(PREFIX)nm
|
|
|
|
LINK = $(PREFIX)gcc
|
|
|
|
LINKXX = $(PREFIX)g++
|
|
|
|
SIZE = $(PREFIX)size
|
2020-02-04 15:21:24 +01:00
|
|
|
_OBJCOPY := $(shell command -v $(PREFIX)objcopy || command -v gobjcopy || command -v objcopy)
|
2020-06-10 18:54:14 +02:00
|
|
|
OBJCOPY ?= $(_OBJCOPY)
|
2016-10-31 22:28:43 +01:00
|
|
|
ifeq ($(OBJCOPY),)
|
2020-06-10 18:54:14 +02:00
|
|
|
$(warning objcopy not found. Hex file will not be created.)
|
|
|
|
OBJCOPY = true
|
2016-10-31 22:28:43 +01:00
|
|
|
endif
|
2019-01-25 16:55:37 +01:00
|
|
|
# Default to the native (g)objdump, helps when using toolchain from docker
|
2020-02-04 15:21:24 +01:00
|
|
|
_OBJDUMP := $(or $(shell command -v $(PREFIX)objdump || command -v gobjdump),objdump)
|
2020-06-10 18:54:14 +02:00
|
|
|
OBJDUMP ?= $(_OBJDUMP)
|
2022-11-18 23:29:12 +01:00
|
|
|
|
2023-01-13 11:44:06 +01:00
|
|
|
GCC_VERSION := $(shell command -v $(CC) > /dev/null && $(CC) -dumpversion | cut -d . -f 1)
|
2022-11-18 23:29:12 +01:00
|
|
|
|
|
|
|
# -fmacro-prefix-map requires GCC 8
|
2022-11-20 14:48:52 +01:00
|
|
|
ifneq (8, $(firstword $(shell echo 8 $(GCC_VERSION) | tr ' ' '\n' | sort -n)))
|
2022-11-18 23:29:12 +01:00
|
|
|
OPTIONAL_CFLAGS_BLACKLIST += -fmacro-prefix-map=$(RIOTBASE)/=
|
|
|
|
endif
|
|
|
|
|
2017-10-06 13:51:47 +02:00
|
|
|
# We use GDB for debugging
|
|
|
|
include $(RIOTMAKE)/tools/gdb.inc.mk
|
2023-04-21 08:57:30 +02:00
|
|
|
|
|
|
|
# Data address spaces starts at zero for all supported architectures. This fixes
|
|
|
|
# compilation at least on MSP430 and AVR.
|
|
|
|
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
2023-06-03 20:10:56 +02:00
|
|
|
ifneq (,$(filter $(GCC_VERSION),12 13))
|
2023-04-21 08:57:30 +02:00
|
|
|
CFLAGS += --param=min-pagesize=0
|
|
|
|
endif
|