Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtools: get rid of warnings about wrong path #7

Merged
merged 1 commit into from
May 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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