aboutsummaryrefslogtreecommitdiff
path: root/bin/build-all.sh
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-02 17:16:25 -0600
committerSelene ToyKeeper2023-11-02 17:16:25 -0600
commit7cb4fe0944b839f28dfd96a88a772cd6a8b58019 (patch)
tree8d3b203f1650edc28b1f67e1589e3bc870b33fa6 /bin/build-all.sh
parentadded LICENSE (GPLv3) (diff)
downloadanduril-7cb4fe0944b839f28dfd96a88a772cd6a8b58019.tar.gz
anduril-7cb4fe0944b839f28dfd96a88a772cd6a8b58019.tar.bz2
anduril-7cb4fe0944b839f28dfd96a88a772cd6a8b58019.zip
reorganized project files (part 1)
(just moved files, didn't change the contents yet, and nothing will work without updating #includes and build scripts and stuff)
Diffstat (limited to 'bin/build-all.sh')
-rwxr-xr-xbin/build-all.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/bin/build-all.sh b/bin/build-all.sh
new file mode 100755
index 0000000..b3fc5d3
--- /dev/null
+++ b/bin/build-all.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# Usage: build-all.sh [pattern]
+# If pattern given, only build targets which match.
+
+if [ ! -z "$1" ]; then
+ SEARCH="$1"
+fi
+
+UI=anduril
+
+date '+#define VERSION_NUMBER "%Y-%m-%d"' > version.h
+
+PASS=0
+FAIL=0
+PASSED=''
+FAILED=''
+
+for TARGET in cfg-*.h ; do
+
+ # maybe limit builds to a specific pattern
+ if [ ! -z "$SEARCH" ]; then
+ echo "$TARGET" | grep -i "$SEARCH" > /dev/null
+ if [ 0 != $? ]; then continue ; fi
+ fi
+
+ # friendly name for this build
+ NAME=$(echo "$TARGET" | perl -ne '/cfg-(.*).h/ && print "$1\n";')
+ echo "===== $NAME ====="
+
+ # figure out MCU type
+ ATTINY=$(grep 'ATTINY:' $TARGET | awk '{ print $3 }')
+ if [ -z "$ATTINY" ]; then ATTINY=85 ; fi
+
+ # try to compile
+ echo ../../../bin/build.sh $ATTINY "$UI" "-DCFG_H=${TARGET}"
+ ../../../bin/build.sh $ATTINY "$UI" "-DCFG_H=${TARGET}"
+
+ # track result, and rename compiled files
+ if [ 0 = $? ] ; then
+ mv -f "$UI".hex "$UI".$NAME.hex
+ PASS=$(($PASS + 1))
+ PASSED="$PASSED $NAME"
+ else
+ echo "ERROR: build failed"
+ FAIL=$(($FAIL + 1))
+ FAILED="$FAILED $NAME"
+ fi
+
+done
+
+# summary
+echo "===== $PASS builds succeeded, $FAIL failed ====="
+#echo "PASS: $PASSED"
+if [ 0 != $FAIL ]; then
+ echo "FAIL:$FAILED"
+fi