2015-05-14 19:09:10 +08:00
|
|
|
ifndef XTOOLS_TOOLCHAIN_PATH
|
2016-09-12 00:43:43 +08:00
|
|
|
|
|
|
|
ifeq ($(CROSS_COMPILE),)
|
2015-05-14 19:09:10 +08:00
|
|
|
$(error XTOOLS_TOOLCHAIN_PATH is not set)
|
2016-09-12 00:43:43 +08:00
|
|
|
else
|
|
|
|
CROSS_COMPILE_TARGET = $(patsubst %-,%,${CROSS_COMPILE})
|
|
|
|
CROSS_COMPILE_ROOT = $(dir $(shell which ${CROSS_COMPILE}gcc))/..
|
2015-05-14 19:09:10 +08:00
|
|
|
endif
|
2015-05-13 12:44:22 +08:00
|
|
|
|
2016-09-12 00:43:43 +08:00
|
|
|
else
|
|
|
|
|
2015-05-13 12:44:22 +08:00
|
|
|
CROSS_COMPILE_TARGET_arm = arm-none-eabi
|
|
|
|
CROSS_COMPILE_TARGET_x86 = i586-pc-elf
|
|
|
|
|
2015-06-02 22:40:34 +08:00
|
|
|
CROSS_COMPILE_TARGET = ${CROSS_COMPILE_TARGET_${ARCH}}
|
2016-09-12 00:43:43 +08:00
|
|
|
CROSS_COMPILE_ROOT = ${XTOOLS_TOOLCHAIN_PATH}/${CROSS_COMPILE_TARGET}
|
|
|
|
CROSS_COMPILE = ${CROSS_COMPILE_ROOT}/bin/${CROSS_COMPILE_TARGET}-
|
|
|
|
|
|
|
|
endif
|
2015-05-13 12:44:22 +08:00
|
|
|
|
2016-09-12 00:43:43 +08:00
|
|
|
TOOLCHAIN_CFLAGS = -I${CROSS_COMPILE_ROOT}/${CROSS_COMPILE_TARGET}/sysroot/usr/include
|
2015-05-19 07:55:02 +08:00
|
|
|
TOOLCHAIN_LIBS = gcc
|
2015-05-17 20:55:21 +08:00
|
|
|
|
2016-09-12 00:43:43 +08:00
|
|
|
CROSS_COMPILE_version = $(shell $(CROSS_COMPILE)gcc -dumpversion)
|
|
|
|
LIB_INCLUDE_DIR += -L ${CROSS_COMPILE_ROOT}/lib/gcc/${CROSS_COMPILE_TARGET}/${CROSS_COMPILE_version}/
|
2015-06-02 22:40:34 +08:00
|
|
|
|
2016-09-12 03:51:22 +08:00
|
|
|
export CROSS_COMPILE TOOLCHAIN_LIBS LIB_INCLUDE_DIR TOOLCHAIN_CFLAGS
|