From patchwork Wed Jan 30 00:34:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Martin X-Patchwork-Id: 216740 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 0388C2C0093 for ; Wed, 30 Jan 2013 11:35:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 204D84A17B; Wed, 30 Jan 2013 01:35:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8i2BItjwXObN; Wed, 30 Jan 2013 01:35:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8C6404A154; Wed, 30 Jan 2013 01:35:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D9E24A154 for ; Wed, 30 Jan 2013 01:35:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id brB4hP1EC-rz for ; Wed, 30 Jan 2013 01:35:16 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from hqemgate03.nvidia.com (hqemgate03.nvidia.com [216.228.121.140]) by theia.denx.de (Postfix) with ESMTPS id 290E14A0A9 for ; Wed, 30 Jan 2013 01:35:13 +0100 (CET) Received: from hqnvupgp05.nvidia.com (Not Verified[216.228.121.13]) by hqemgate03.nvidia.com id ; Tue, 29 Jan 2013 16:39:30 -0800 Received: from hqemhub02.nvidia.com ([172.17.108.22]) by hqnvupgp05.nvidia.com (PGP Universal service); Tue, 29 Jan 2013 16:35:06 -0800 X-PGP-Universal: processed; by hqnvupgp05.nvidia.com on Tue, 29 Jan 2013 16:35:06 -0800 Received: from badger.nvidia.com (172.20.144.16) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server id 8.3.297.1; Tue, 29 Jan 2013 16:35:06 -0800 From: Allen Martin To: , , , Date: Tue, 29 Jan 2013 16:34:58 -0800 Message-ID: <1359506098-4380-1-git-send-email-amartin@nvidia.com> X-Mailer: git-send-email 1.7.10.4 X-NVConfidentiality: public MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2] MAKEALL: add support for per architecture toolchains X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: Simon Glass Reviewed-by: Stephen Warren --- v2: Changed CROSS_COMPILE_ARM to CROSS_COMPILE_ in help text --- MAKEALL | 32 +++++++++++++++++++++++++------- 1 file 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_ 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