zephyr/scripts/Makefile.toolchain.iamcu
Anas Nashif 04727bcf9e toolchain: remove hardcoded compiler versions
When the SDK is updated usually it comes with new versions of the
compiler causing issues with the toolchain not finding libraries.

This will get the version from the compiler and sets the path
accordingly.

Change-Id: I854c57bb082ae8136eebdd0ae7a8c151c1d699c8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:14 -05:00

25 lines
883 B
Makefile

ifndef IAMCU_TOOLCHAIN_PATH
$(error IAMCU_TOOLCHAIN_PATH is not set)
endif
CROSS_COMPILE_TARGET_x86 = i586-intel-elfiamcu
CROSS_COMPILE_x86=${IAMCU_TOOLCHAIN_PATH}/bin/${CROSS_COMPILE_TARGET_x86}-
TOOLCHAIN_CFLAGS_x86 = -I${IAMCU_TOOLCHAIN_PATH}/$(CROSS_COMPILE_TARGET_x86)/include/
CROSS_COMPILE_x86_version = $(shell $(CROSS_COMPILE_x86)gcc -dumpversion)
CROSS_COMPILE= $(CROSS_COMPILE_$(ARCH))
LIB_INCLUDE_DIR_x86 = -L $(IAMCU_TOOLCHAIN_PATH)/lib/gcc/$(CROSS_COMPILE_TARGET_x86)/$(CROSS_COMPILE_x86_version)
LIB_INCLUDE_DIR_x86 += -L ${IAMCU_TOOLCHAIN_PATH}/$(CROSS_COMPILE_TARGET_x86)/lib
LIB_INCLUDE_DIR = $(LIB_INCLUDE_DIR_$(ARCH))
TOOLCHAIN_LIBS = gcc
TOOLCHAIN_CFLAGS = $(TOOLCHAIN_CFLAGS_$(ARCH))
LD_TOOLCHAIN ?= -D__GCC_LINKER_CMD__ -D__IAMCU
OUTPUT_FORMAT = elf32-iamcu
OUTPUT_ARCH = iamcu:intel
export CROSS_COMPILE TOOLCHAIN_LIBS LIB_INCLUDE_DIR TOOLCHAIN_CFLAGS