changeset 610:a47844b73616

New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
author Rob Landley <rob@landley.net>
date Fri, 06 Feb 2009 00:21:02 -0600
parents 3c30ce98c273
children e111467e0476
files buildall.sh sources/build-all-targets.sh
diffstat 2 files changed, 50 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/buildall.sh	Fri Feb 06 00:21:02 2009 -0600
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# Build every target architecture, creating out-$ARCH.txt log files.
+# If $FORK is set, build them in parallel.
+
+. sources/functions.sh
+
+# Build one architecture, capturing log output.
+
+buildit()
+{
+  (time ./build.sh $1) 2>&1 | tee out-$1.txt
+}
+
+# Build in the background or foreground depending on $FORK
+
+buildlog()
+{
+  [ ! -z "$FORK" ] && (buildit $i | grep '^===' &) || buildit $i
+}
+
+# Perform initial setup that doesn't parallelize well.  Download source,
+# build host tools, extract source.
+
+(./download.sh && ./host-tools.sh && ./download.sh --extract ) 2>&1 | tee out-host.txt
+
+# Build architectures
+
+for i in $(cd sources/targets/; ls | grep -v '^hw-')
+do
+  buildlog $i
+done
+
+# Wait for architectures to complete
+
+wait4background 0
+
+# Now build hardware targets
+
+for i in $(cd sources/targets; ls | grep '^hw-')
+do
+  buildlog $i
+done
+
+# Wait for hardware targets to complete
+
+wait4background 0
--- a/sources/build-all-targets.sh	Tue Feb 03 11:12:19 2009 -0600
+++ b/sources/build-all-targets.sh	Fri Feb 06 00:21:02 2009 -0600
@@ -1,93 +1,8 @@
-#!/bin/bash
-
-# Nightly snapshot build script.
-
-# Wrapper can set:
-# USE_UNSTABLE=busybox,toybox,uClibc
-# USE_STATIC_HOST=i686
-
-[ -z "$NICE" ] && NICE="nice -n 20"
-
-source sources/functions.sh
-
-# Parse command line arguments
-
-FORKCOUNT=1
-while [ ! -z "$1" ]
-do
-  if [ "$1" == "--fork" ]
-  then
-    shift
-    FORKCOUNT="$(echo $1 | sed -n '/^[0-9]/{;s/[^0-9]//g;p;}')"
-    [ ! -z "$FORKCOUNT" ] && shift || FORKCOUNT=0
-  elif [ "$1" == "--static-host" ]
-  then
-    shift
-    USE_STATIC_HOST="$1"
-    shift
-  else
-    echo "Unknown argument $1"
-    dienow
-  fi
-done
-
-# Define functions
-
-function build_this_target()
-{
-  if [ ! -e build/cross-compiler-$1/bin/$1-gcc ]
-  then
-    $NICE ./cross-compiler.sh $1 &&
-    ln build/cross-compiler-$1.tar.bz2 buildall || return 1
-  fi
+# leftover things that buildall.sh doesn't do yet.
 
-  $NICE ./mini-native.sh $1 &&
-  ln build/mini-native-$1.tar.bz2 buildall || return 1
-
-  $NICE ./package-mini-native.sh $1 &&
-  ln build/system-image-$1.tar.bz2 buildall || return 1
-}
-
-function build_and_log()
-{
-  { build_this_target $ARCH 2>&1 || ([ ! -z "$FAIL_FATAL" ] && dienow)
-  } | tee >(bzip2 > buildall/logs/$1-$ARCH.txt.bz2)
-}
-
-# Iterate through architectures, either sequentially or in parallel.
-# Run "$1 $ARCH", in parallel if necessary.
+exit 1
 
-function for_each_arch()
-{
-  for ARCH in $(cd sources/targets; ls);
-  do
-    echo Launching $ARCH
-    if [ "$FORKCOUNT" -eq 1 ]
-    then
-      FAIL_FATAL=1 "$@" "$ARCH" || dienow
-    else
-      ("$@" $ARCH 2>&1 </dev/null |
-       grep "^==="; echo Completed $i ) &
-      [ "$FORKCOUNT" -gt 0 ] && wait4background $[${FORKCOUNT}-1] "ssh "
-    fi
-  done
-
-  wait4background 0
-}
-
-# Clean up old builds, fetch fresh packages.
-
-rm -rf build/host
-(hg pull -u; ./download.sh || dienow) &
-rm -rf build buildall &
-wait4background 0
-
-mkdir -p buildall/logs || dienow
-
-# Build host tools, extract packages (not asynchronous).
-
-($NICE ./host-tools.sh && $NICE ./download.sh --extract || dienow) 2>&1 |
-  tee >(bzip2 > buildall/logs/host-tools.txt.bz2)
+# USE_STATIC_HOST=i686
 
 # Create and upload readme (requires build/sources to be extracted)
 
@@ -136,7 +51,3 @@
     tar -xj -f $i -C build || dienow
   done
 fi
-
-# Build each architecture
-
-for_each_arch build_and_log native