From patchwork Thu May 10 06:36:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Fleming X-Patchwork-Id: 158199 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 570FEB6FB7 for ; Thu, 10 May 2012 16:51:58 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0177C2808C; Thu, 10 May 2012 08:51:55 +0200 (CEST) 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 Z-w+5hQp67Hy; Thu, 10 May 2012 08:51:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 51C6828086; Thu, 10 May 2012 08:51:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D8D6A28086 for ; Thu, 10 May 2012 08:51:47 +0200 (CEST) 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 s7+quVYTAtU0 for ; Thu, 10 May 2012 08:51:46 +0200 (CEST) X-Greylist: delayed 905 seconds by postgrey-1.27 at theia; Thu, 10 May 2012 08:51:44 CEST 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 db3outboundpool.messaging.microsoft.com (db3ehsobe002.messaging.microsoft.com [213.199.154.140]) by theia.denx.de (Postfix) with ESMTPS id 135DE28085 for ; Thu, 10 May 2012 08:51:44 +0200 (CEST) Received: from mail9-db3-R.bigfish.com (10.3.81.232) by DB3EHSOBE003.bigfish.com (10.3.84.23) with Microsoft SMTP Server id 14.1.225.23; Thu, 10 May 2012 06:36:38 +0000 Received: from mail9-db3 (localhost [127.0.0.1]) by mail9-db3-R.bigfish.com (Postfix) with ESMTP id 2C760300081; Thu, 10 May 2012 06:36:38 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bh) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail9-db3 (localhost.localdomain [127.0.0.1]) by mail9-db3 (MessageSwitch) id 133663179674898_23047; Thu, 10 May 2012 06:36:36 +0000 (UTC) Received: from DB3EHSMHS010.bigfish.com (unknown [10.3.81.225]) by mail9-db3.bigfish.com (Postfix) with ESMTP id 02DDE220051; Thu, 10 May 2012 06:36:36 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS010.bigfish.com (10.3.87.110) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 10 May 2012 06:36:35 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.1.355.3; Thu, 10 May 2012 01:36:33 -0500 Received: from localhost (right.am.freescale.net [10.82.193.13]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q4A6aWC7025883; Wed, 9 May 2012 23:36:32 -0700 From: Andy Fleming To: Wolfgang Denk Date: Thu, 10 May 2012 01:36:28 -0500 Message-ID: <1336631788-28127-1-git-send-email-afleming@freescale.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] Improve MAKEALL parallel builds 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 The patch that added parallel builds broke MAKEALL -l, so this fixes that. At the same time, it improves the termination so that it shuts down the build threads if you cancel the build. Lastly, it removes a bunch of debug code. Signed-off-by: Andy Fleming Tested-by: Wolfgang Denk --- MAKEALL | 34 ++++++++++++++++++---------------- 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/MAKEALL b/MAKEALL index 5b610bf..05e2d90 100755 --- a/MAKEALL +++ b/MAKEALL @@ -340,12 +340,7 @@ LIST_ARM9="$(boards_by_cpu arm920t) \ ######################################################################### ## ARM11 Systems ######################################################################### -LIST_ARM11="$(boards_by_cpu arm1136) \ - imx31_phycore \ - imx31_phycore_eet \ - mx31pdk \ - smdk6400 \ -" +LIST_ARM11="$(boards_by_cpu arm1136)" ######################################################################### ## ARMV7 Systems @@ -615,6 +610,11 @@ build_target() { target=$1 build_idx=$2 + if [ "$ONLY_LIST" == 'y' ] ; then + list_target ${target} + return + fi + if [ $BUILD_MANY == 1 ] ; then output_dir="${OUTPUT_PREFIX}/${target}" mkdir -p "${output_dir}" @@ -624,11 +624,6 @@ build_target() { export BUILD_DIR="${output_dir}" - if [ "$ONLY_LIST" == 'y' ] ; then - list_target ${target} - return - fi - ${MAKE} distclean >/dev/null ${MAKE} -s ${target}_config @@ -666,16 +661,15 @@ build_target() { [ -e "${LOG_DIR}/${target}.ERR" ] && cat "${LOG_DIR}/${target}.ERR" - #echo "Writing ${donep}${build_idx}" touch "${donep}${build_idx}" } manage_builds() { search_idx=${OLDEST_IDX} - #echo "Searching ${OLDEST_IDX} to ${TOTAL_CNT}" + if [ "$ONLY_LIST" == 'y' ] ; then return ; fi + while true; do if [ -e "${donep}${search_idx}" ] ; then - # echo "Found ${donep}${search_idx}" : $(( CURRENT_CNT-- )) [ ${OLDEST_IDX} -eq ${search_idx} ] && : $(( OLDEST_IDX++ )) @@ -687,10 +681,8 @@ manage_builds() { [ ${OLDEST_IDX} -eq ${search_idx} ] && : $(( OLDEST_IDX++ )) fi - #echo "Checking search ${search_idx} vs ${TOTAL_CNT}" : $(( search_idx++ )) if [ ${search_idx} -gt ${TOTAL_CNT} ] ; then - #echo "Checking current ${CURRENT_CNT} vs ${BUILD_NBUILDS}" if [ ${CURRENT_CNT} -ge ${BUILD_NBUILDS} ] ; then search_idx=${OLDEST_IDX} sleep 1 @@ -739,6 +731,12 @@ build_targets() { #----------------------------------------------------------------------- +kill_children() { + kill -- "-$1" + + exit +} + print_stats() { if [ "$ONLY_LIST" == 'y' ] ; then return ; fi @@ -759,6 +757,10 @@ print_stats() { fi echo "----------------------------------------------------------" + if [ $BUILD_MANY == 1 ] ; then + kill_children $$ & + fi + exit $RC }