changeset 1114:be94bf38648b

Break up buildall.sh so it's easier to run individual portions of it.
author Rob Landley <rob@landley.net>
date Sun, 13 Jun 2010 23:50:40 -0500
parents e5ace7f9f4d4
children 81bae2e7bc66
files sources/more/build-control-images.sh sources/more/buildall.sh sources/more/for-each-target.sh
diffstat 3 files changed, 50 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/more/build-control-images.sh	Sun Jun 13 23:50:40 2010 -0500
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Iterate through sources/native-builds and run each script, writing output
+# to build/control-images/$SCRIPTNAME.hdc
+
+. sources/include.sh || exit 1
+
+mkdir -p build/control-images || dienow
+for i in sources/native-builds/*.sh
+do
+  SCRIPTNAME=$(echo $i | sed 's@.*/\(.*\)\.sh@\1@')
+  maybe_fork "$i build/control-images/$SCRIPTNAME.hdc | maybe_quiet"
+done
--- a/sources/more/buildall.sh	Sun Jun 13 22:57:07 2010 -0500
+++ b/sources/more/buildall.sh	Sun Jun 13 23:50:40 2010 -0500
@@ -43,39 +43,32 @@
 
 # Build all non-hw targets, possibly in parallel
 
-for i in ${ARCHES}
+sources/more/for-each-target.sh \
+  './build.sh $TARGET 2>&1 | tee build/logs/build-${TARGET}.txt'
+
+# Run smoketest.sh for each non-hw target.
+
+sources/more/for-each-target.sh \
+  './smoketest.sh $TARGET 2>&1 | tee build/logs/smoketest-$TARGET.txt'
+
+sources/more/build-control-images.sh
+
+# Build all control images
+
+mkdir -p build/control-images || dienow
+for i in sources/native-builds/*.sh
 do
-  maybe_fork "./build.sh $i 2>&1 | tee build/logs/build-${i}.txt | maybe_quiet"
+  X=$(echo $i | sed 's@.*/\(.*\)\.sh@\1@')
+  maybe_fork "$i build/control-images/${X}.hdc | maybe_quiet"
 done
 
 wait
 
-# Build all hw targets, possibly in parallel
-
-for i in ${HWARCHES}
-do
-  maybe_fork "./build.sh $i 2>&1 | tee build/logs/build-${i}.txt | maybe_quiet"
-done
-
-# Run smoketest.sh for each non-hw target.
+# Build static-tools (dropbear and strace) for each target
 
-for i in ${ARCHES}
-do
-  maybe_fork "./smoketest.sh $i 2>&1 | tee build/logs/smoketest-$i.txt | maybe_quiet"
-done
-
-wait
-
-# Build dropbear and strace
-
-sources/native-builds/static-tools.sh build/host-temp/hdc.sqf &&
 mkdir -p build/native-static &&
-for i in ${ARCHES}
-do
-  maybe_fork "(cd build/system-image-$i && ln -s ../native-static upload && ../more/timeout.sh 60 ./native-build.sh ../host-temp/hdc.sqf) | tee build/logs/native-$i.txt | maybe_quiet"
-done
-
-wait
+sources/more/for-each-target.sh \
+  'sources/more/timeout.sh 60 "(cd build/system-image-$TARGET && ln -s ../native-static upload && ./native-build.sh ../control-images/static-tools.hdc) | tee build/logs/native-$TARGET.txt"'
 
 # Create a file containing simple pass/fail results for all architectures.
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/more/for-each-target.sh	Sun Jun 13 23:50:40 2010 -0500
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Iterate through every target architecture, running rest of command line
+# on each $TARGET.
+
+# If $FORK is set, run them in parallel with filtered output.
+
+. sources/functions.sh || exit 1
+
+[ -z "${ARCHES}" ] &&
+  ARCHES="$(cd sources/targets/; ls | grep -v '^hw-')"
+
+for TARGET in $ARCHES
+do
+  maybe_fork "$* | maybe_quiet"
+done
+
+wait