zephyr/scripts
Juro Bystricky f25ac092b9 Makefile: Restructure for multilibs
Several Zephyr SDK toolchains support multilibs.
Instead of hard-coding locations of the libraries, the proper/cleanest way
is to query the GCC compiler for the locations of libgcc and libc.
However, in order to do this, we need to ensure a certain order of
initialization in the Makefile:

1. Determine CROSS_COMPILE.
   We cannot determine LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS yet, as we don't
   know the KBUILD_CFLAGS yet.

2. Calculate KBUILD_CFLAGS using CROSS_COMPILE
   KBUILD_CFLAGS often need the compiler to validate options, i.e:
   KBUILD_CFLAGS += $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0)
   However,  LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS should not be needed for this

3. Finally, using CROSS_COMPILE and KBUILD_CFLAGS determine LIB_INCLUDE_DIR,
   TOOLCHAIN_CFLAGS by querying GCC using -print-libgcc-file-name and
   -print-multi-directory command line options.

This change should only affect Zephyr SDK toolchains, all other toolchains
are expected to function as before.

Change-Id: I27b460d46fe65d05fcb8bafb51cd6b3deba275ed
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 17:15:56 +00:00
..
basic
cross_compiler
gen_idt
gen_offset_header
kconfig
patches
sanity_chk
support
.gitignore
build_grub.sh
check_known_checkpatch_issues.sh
checkconfig.py
checkpatch.pl
checkstack.pl
compare_footprint
config
diffconfig
do_checkpatch.sh
expr_parser.py
filter-known-issues.py
gcc-version.sh
headerdep.pl
Kbuild.include
maintainer-checkpatch.bash
make-ll
Makefile
Makefile.build
Makefile.clean
Makefile.extrawarn
Makefile.headersinst
Makefile.help
Makefile.host
Makefile.lib
Makefile.modbuiltin
Makefile.toolchain.gccarmemb
Makefile.toolchain.issm
Makefile.toolchain.xtools
Makefile.toolchain.zephyr
mkmakefile
mksysmap
qemu-machine-hack.py
sanitycheck
size_report
spelling.txt
sysgen
tags.sh
timestamp