From 8eb6e9b5e37f8d2f0f97f77d5a23291c9dc9e6b6 Mon Sep 17 00:00:00 2001 From: Alexander Holler Date: Tue, 4 Mar 2014 07:17:29 +0100 Subject: [PATCH] Make it possible to use another toolchain by defining CROSS_COMPILE It's much easier to use e.g. CROSS_COMPILE=arm-cortexm3-eabi- make than to change a dozen lines in two Makefiles. --- firmware/bootloader/Makefile | 19 ++++++++++--------- firmware/common.mk | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/firmware/bootloader/Makefile b/firmware/bootloader/Makefile index dd01e22a..bd48838f 100644 --- a/firmware/bootloader/Makefile +++ b/firmware/bootloader/Makefile @@ -239,15 +239,16 @@ PROGDEV ?= /dev/ttyUSB0 #============================================================================ # Define programs and commands. -CC = arm-none-eabi-gcc -LD = arm-none-eabi-gcc -T -AS = arm-none-eabi-as -OBJCOPY = arm-none-eabi-objcopy -OBJDUMP = arm-none-eabi-objdump -READELF = arm-none-eabi-readelf -SIZE = arm-none-eabi-size -AR = arm-none-eabi-ar -r -NM = arm-none-eabi-nm +CROSS_COMPILE ?= arm-none-eabi- +CC = $(CROSS_COMPILE)gcc +LD = $(CROSS_COMPILE)gcc -T +AS = $(CROSS_COMPILE)as +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump +READELF = $(CROSS_COMPILE)readelf +SIZE = $(CROSS_COMPILE)size +AR = $(CROSS_COMPILE)ar -r +NM = $(CROSS_COMPILE)nm REMOVE = rm -f # Define Messages diff --git a/firmware/common.mk b/firmware/common.mk index 47160d3a..6e0c17e4 100644 --- a/firmware/common.mk +++ b/firmware/common.mk @@ -244,15 +244,16 @@ PROGDEV ?= /dev/ttyUSB0 #============================================================================ # Define programs and commands. -CC = arm-none-eabi-gcc -LD = arm-none-eabi-gcc -T -AS = arm-none-eabi-as -OBJCOPY = arm-none-eabi-objcopy -OBJDUMP = arm-none-eabi-objdump -READELF = arm-none-eabi-readelf -SIZE = arm-none-eabi-size -AR = arm-none-eabi-ar -r -NM = arm-none-eabi-nm +CROSS_COMPILE ?= arm-none-eabi- +CC = $(CROSS_COMPILE)gcc +LD = $(CROSS_COMPILE)gcc -T +AS = $(CROSS_COMPILE)as +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump +READELF = $(CROSS_COMPILE)readelf +SIZE = $(CROSS_COMPILE)size +AR = $(CROSS_COMPILE)ar -r +NM = $(CROSS_COMPILE)nm REMOVE = rm -f #