Skip to content

Commit

Permalink
xtools: get rid of warnings about wrong path
Browse files Browse the repository at this point in the history
Eliminate following errors:

make[2]: /home/nashif/Work/sdk/xtools/outdir/x-tools//bin/-gcc: Command
not found
make[2]: /home/nashif/Work/sdk/xtools/outdir/x-tools//bin/-gcc: Command
not found
make[2]: /home/nashif/Work/sdk/xtools/outdir/x-tools//bin/-gcc: Command
not found

Also, usage of CROSS_COMPILE with a predefined toolchain is not required and
complicates things, just call CROSS_COMPILE with the full path if you
want to build with a toolchain not supported with Zephyr.

Change-Id: I93ec4ff2e04d22cee82c8e4b74b652927572b30a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information
nashif authored and Anas Nashif committed May 19, 2017
1 parent 34ac008 commit 96def63
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions scripts/Makefile.toolchain.xtools
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
ifndef XTOOLS_TOOLCHAIN_PATH

ifeq ($(CROSS_COMPILE),)
$(error XTOOLS_TOOLCHAIN_PATH is not set)
else
CROSS_COMPILE_TARGET = $(patsubst %-,%,${CROSS_COMPILE})
CROSS_COMPILE_ROOT = $(dir $(shell which ${CROSS_COMPILE}gcc))/..
endif

else
ifndef MAKEFILE_TOOLCHAIN_DO_PASS2

# arm
CROSS_COMPILE_TARGET_arm = arm-none-eabi
CROSS_COMPILE_TARGET_x86 = i586-pc-elf

# x86
CROSS_COMPILE_TARGET_x86 = i586-unknown-elf

CROSS_COMPILE_TARGET = ${CROSS_COMPILE_TARGET_${ARCH}}
CROSS_COMPILE_ROOT = ${XTOOLS_TOOLCHAIN_PATH}/${CROSS_COMPILE_TARGET}
CROSS_COMPILE = ${CROSS_COMPILE_ROOT}/bin/${CROSS_COMPILE_TARGET}-

endif
else

CROSS_COMPILE = ${CROSS_COMPILE_ROOT}/bin/${CROSS_COMPILE_TARGET}-

TOOLCHAIN_CFLAGS = -I${CROSS_COMPILE_ROOT}/${CROSS_COMPILE_TARGET}/sysroot/usr/include
TOOLCHAIN_LIBS = gcc

CROSS_COMPILE_version = $(shell $(CROSS_COMPILE)gcc -dumpversion)
LIB_INCLUDE_DIR += -L ${CROSS_COMPILE_ROOT}/lib/gcc/${CROSS_COMPILE_TARGET}/${CROSS_COMPILE_version}/

endif

export CROSS_COMPILE TOOLCHAIN_LIBS LIB_INCLUDE_DIR TOOLCHAIN_CFLAGS

ifndef MAKEFILE_TOOLCHAIN_DO_PASS2
MAKEFILE_TOOLCHAIN_DO_PASS2=true
endif

0 comments on commit 96def63

Please sign in to comment.