aboutsummaryrefslogtreecommitdiff
path: root/MAKEALL
diff options
context:
space:
mode:
authorAllen Martin <amartin@nvidia.com>2013-01-29 14:34:58 +0000
committerTom Rini <trini@ti.com>2013-02-20 09:40:34 -0500
commit47104c37de076e2be35ae1b3d144614f4d24a766 (patch)
treed431709a99a447a3d1c9762833be7d51d644e553 /MAKEALL
parent3e34cf7bffb87f3a96a87a4d1e0a76df7322b3c1 (diff)
downloadu-boot-47104c37de076e2be35ae1b3d144614f4d24a766.zip
u-boot-47104c37de076e2be35ae1b3d144614f4d24a766.tar.gz
u-boot-47104c37de076e2be35ae1b3d144614f4d24a766.tar.bz2
MAKEALL: add support for per architecture toolchains
Add support for per architecture CROSS_COMPILE toolchain definitions via CROSS_COMPILE_ARCH where "ARCH" is any of the supported u-boot architectures. This allows building every supported u-boot board in a single pass of MAKEALL. Signed-off-by: Allen Martin <amartin@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
Diffstat (limited to 'MAKEALL')
-rwxr-xr-xMAKEALL32
1 files changed, 25 insertions, 7 deletions
diff --git a/MAKEALL b/MAKEALL
index 5b06c54..397adef 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -35,6 +35,9 @@ usage()
Environment variables:
BUILD_NCPUS number of parallel make jobs (default: auto)
CROSS_COMPILE cross-compiler toolchain prefix (default: "")
+ CROSS_COMPILE_<ARCH> cross-compiler toolchain prefix for
+ architecture "ARCH". Substitute "ARCH" for any
+ supported architecture (default: "")
MAKEALL_LOGDIR output all logs to here (default: ./LOG/)
BUILD_DIR output build directory (default: ./)
BUILD_NBUILDS number of parallel targets (default: 1)
@@ -180,13 +183,6 @@ else
JOBS=""
fi
-
-if [ "${CROSS_COMPILE}" ] ; then
- MAKE="make CROSS_COMPILE=${CROSS_COMPILE}"
-else
- MAKE=make
-fi
-
if [ "${MAKEALL_LOGDIR}" ] ; then
LOG_DIR=${MAKEALL_LOGDIR}
else
@@ -585,6 +581,18 @@ get_target_maintainers() {
echo "$mail"
}
+get_target_arch() {
+ local target=$1
+
+ # Automatic mode
+ local line=`egrep -i "^[[:space:]]*${target}[[:space:]]" boards.cfg`
+
+ if [ -z "${line}" ] ; then echo "" ; return ; fi
+
+ set ${line}
+ echo "$2"
+}
+
list_target() {
if [ "$PRINT_MAINTS" != 'y' ] ; then
echo "$1"
@@ -655,6 +663,16 @@ build_target() {
export BUILD_DIR="${output_dir}"
+ target_arch=$(get_target_arch ${target})
+ eval cross_toolchain=\$CROSS_COMPILE_${target_arch^^}
+ if [ "${cross_toolchain}" ] ; then
+ MAKE="make CROSS_COMPILE=${cross_toolchain}"
+ elif [ "${CROSS_COMPILE}" ] ; then
+ MAKE="make CROSS_COMPILE=${CROSS_COMPILE}"
+ else
+ MAKE=make
+ fi
+
${MAKE} distclean >/dev/null
${MAKE} -s ${target}_config