From cad5f08b56a0aa8bf0a59da3ec6ba036caefc7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Mon, 21 Mar 2016 09:03:20 +0100 Subject: [PATCH 1/4] Makefile.include: Set PREFIX if not set --- Makefile.include | 4 ++++ cpu/Makefile.include.cortexm_common | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.include b/Makefile.include index 4decf6ed66..2955ef44f6 100644 --- a/Makefile.include +++ b/Makefile.include @@ -159,6 +159,10 @@ endif export TOOLCHAIN +# 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)-) + # Import all toolchain settings include $(RIOTCPU)/Makefile.include.$(TOOLCHAIN) diff --git a/cpu/Makefile.include.cortexm_common b/cpu/Makefile.include.cortexm_common index 6537e465ca..4eac243493 100644 --- a/cpu/Makefile.include.cortexm_common +++ b/cpu/Makefile.include.cortexm_common @@ -1,10 +1,6 @@ # Target triple for the build. Use arm-none-eabi if you are unsure. export TARGET_ARCH ?= arm-none-eabi -# 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)-) - # define build specific options export CFLAGS_CPU = -mcpu=$(MCPU) -mlittle-endian -mthumb $(CFLAGS_FPU) ifneq (llvm,$(TOOLCHAIN)) From d0033a5d20049ac3a01e09adc2cb98a6c677e6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Mon, 21 Mar 2016 09:25:42 +0100 Subject: [PATCH 2/4] avr: Use TARGET_ARCH instead of custom toolchain specification --- boards/arduino-mega2560/Makefile.include | 9 --------- cpu/atmega_common/Makefile.include | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/boards/arduino-mega2560/Makefile.include b/boards/arduino-mega2560/Makefile.include index 1827bced6d..3ca09bf8d7 100644 --- a/boards/arduino-mega2560/Makefile.include +++ b/boards/arduino-mega2560/Makefile.include @@ -1,15 +1,6 @@ # define the cpu used by the arduino mega2560 board export CPU = atmega2560 -# define tools used for building the project -export PREFIX = avr- -export CC = $(PREFIX)gcc -export CXX = $(PREFIX)c++ -export AR = $(PREFIX)ar -export AS = $(PREFIX)as -export LINK = $(PREFIX)gcc -export SIZE = $(PREFIX)size -export OBJCOPY = $(PREFIX)objcopy export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm export TERMFLAGS = -b 9600 -p $(PORT) diff --git a/cpu/atmega_common/Makefile.include b/cpu/atmega_common/Makefile.include index 02ce40deac..efd66a0dbf 100644 --- a/cpu/atmega_common/Makefile.include +++ b/cpu/atmega_common/Makefile.include @@ -1,3 +1,5 @@ +# Target architecture for the build. Use avr if you are unsure. +export TARGET_ARCH ?= avr # include module specific includes export INCLUDES += -I$(RIOTCPU)/atmega_common/include -isystem$(RIOTCPU)/atmega_common/avr-libc-extra From 1efe384d6fc128f1ca756c37435b8ac0ee47f335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Mon, 21 Mar 2016 09:27:23 +0100 Subject: [PATCH 3/4] arm7: Use TARGET_ARCH instead of custom toolchain specification --- boards/msba2-common/Makefile.include | 13 ------------- cpu/arm7_common/Makefile.include | 3 +++ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/boards/msba2-common/Makefile.include b/boards/msba2-common/Makefile.include index 5ea7992a93..7f29043611 100644 --- a/boards/msba2-common/Makefile.include +++ b/boards/msba2-common/Makefile.include @@ -1,19 +1,6 @@ ## the cpu to build for export CPU = lpc2387 -# Target triple for the build. Use arm-none-eabi if you are unsure. -export TARGET_ARCH ?= arm-none-eabi - -# toolchain config -export PREFIX = $(if $(TARGET_ARCH),$(TARGET_ARCH)-) - -export CC = $(PREFIX)gcc -export CXX = $(PREFIX)g++ -export AR = $(PREFIX)ar -export AS = $(PREFIX)as -export LINK = $(PREFIX)gcc -export SIZE = $(PREFIX)size -export OBJCOPY = $(PREFIX)objcopy FLASHER = lpc2k_pgm TERMPROG ?= $(RIOTBASE)/dist/tools/pyterm/pyterm diff --git a/cpu/arm7_common/Makefile.include b/cpu/arm7_common/Makefile.include index 6706e4cf53..9e9054aef4 100644 --- a/cpu/arm7_common/Makefile.include +++ b/cpu/arm7_common/Makefile.include @@ -1 +1,4 @@ +# Target architecture for the build. Use arm-none-eabi if you are unsure. +export TARGET_ARCH ?= arm-none-eabi + INCLUDES += -I$(RIOTBASE)/cpu/arm7_common/include/ From fbde276bb13be439162b03514e20fb3e878117a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Mon, 21 Mar 2016 12:19:04 +0100 Subject: [PATCH 4/4] msp430: Set TARGET_ARCH for msp430 targets --- cpu/Makefile.include.msp430_common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/Makefile.include.msp430_common b/cpu/Makefile.include.msp430_common index 29fe0e36a8..b0d29eac0f 100644 --- a/cpu/Makefile.include.msp430_common +++ b/cpu/Makefile.include.msp430_common @@ -1,5 +1,5 @@ -# default toolchain prefix -export PREFIX ?= msp430- +# Target architecture for the build. Use msp430 if you are unsure. +export TARGET_ARCH ?= msp430 # define build specific options CFLAGS_CPU = -mmcu=$(CPU_MODEL)