aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rwxr-xr-xscripts/cross.sh14
2 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 69d24870..316df2f8 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ root_clean:
@echo root cleaned
clean::
- @rm -rf toybox generated change .singleconfig* cross-log-*.*
+ @rm -rf toybox generated change .singleconfig*
@echo cleaned
# If singlemake was in generated/ "make clean; make test_ls" wouldn't work.
diff --git a/scripts/cross.sh b/scripts/cross.sh
index 2570713d..bdf03ed9 100755
--- a/scripts/cross.sh
+++ b/scripts/cross.sh
@@ -25,6 +25,9 @@ list()
}
[ $# -eq 0 ] && list && exit
+[ -z "$TOP" ] && TOP="$PWD/root/log"
+mkdir -p "$TOP" || exit 1
+
X="$1"
shift
@@ -33,11 +36,18 @@ if [ "$X" == all ]
then
for TARGET in $(list)
do
+ LOG="$TOP/cross-log-$TARGET"
{
export TARGET
echo -en "\033]2;$TARGET $*\007"
- "$0" $TARGET "$@" 2>&1 || mv cross-log-$TARGET.{txt,failed}
- } | tee cross-log-$TARGET.txt
+
+ rm -f "$LOG".{failed,success}
+ "$0" $TARGET "$@" 2>&1
+ X=$?
+ [ $X -eq 0 -o $X -eq 42 ] && mv "$LOG".{txt,success}
+ } |& tee "$LOG".txt
+ [ -z "$ALL" ] && [ ! -e "$LOG".success ] &&
+ { mv "$LOG".{txt,failed} ; break;}
done
exit