[build system] prefer compiler/toolchain found in path

fixes #231
also use a common makefile for finding the toolchain
see #244
This commit is contained in:
Felix Ruess
2012-07-25 22:05:34 +02:00
parent f4cbb7b026
commit 9e663f2ef5
7 changed files with 152 additions and 229 deletions
+1 -16
View File
@@ -66,21 +66,6 @@ OCAML=$(shell which ocaml)
OCAMLRUN=$(shell which ocamlrun)
BUILD_DATETIME:=$(shell date +%Y%m%d-%H%M%S)
# try to find the paparazzi multilib toolchain
TOOLCHAIN=$(shell find -L /opt/paparazzi/arm-multilib ~/sat -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1)
ifneq ($(TOOLCHAIN),)
TOOLCHAIN_DIR=$(shell dirname $(TOOLCHAIN))
#found the compiler from the paparazzi multilib package
ARMGCC=$(TOOLCHAIN_DIR)/bin/arm-none-eabi-gcc
else
#try picking up the arm-none-eabi compiler from the path, otherwise use arm-elf
HAVE_ARM_NONE_EABI_GCC := $(shell which arm-none-eabi-gcc)
ifeq ($(strip $(HAVE_ARM_NONE_EABI_GCC)),)
ARMGCC=$(shell which arm-elf-gcc)
else
ARMGCC=$(HAVE_ARM_NONE_EABI_GCC)
endif
endif
all: conf commands static
@@ -127,7 +112,7 @@ multimon:
static_h: $(MESSAGES_H) $(MESSAGES2_H) $(UBX_PROTOCOL_H) $(MTK_PROTOCOL_H) $(XSENS_PROTOCOL_H) $(DL_PROTOCOL_H) $(DL_PROTOCOL2_H)
usb_lib:
@[ -d sw/airborne/arch/lpc21/lpcusb ] && ((test -x "$(ARMGCC)" && (cd sw/airborne/arch/lpc21/lpcusb; $(MAKE))) || echo "Not building usb_lib: ARMGCC=$(ARMGCC) not found") || echo "Not building usb_lib: sw/airborne/arch/lpc21/lpcusb directory missing"
@[ -d sw/airborne/arch/lpc21/lpcusb ] && (cd sw/airborne/arch/lpc21/lpcusb; $(MAKE)) || echo "Not building usb_lib: sw/airborne/arch/lpc21/lpcusb directory missing"
ext:
$(MAKE) -C$(EXT) all