aboutsummaryrefslogtreecommitdiff
path: root/bin/build-all.sh
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-03 08:40:42 -0600
committerSelene ToyKeeper2023-11-03 08:40:42 -0600
commit82013a73328ca6e2901d58661e37ccc9b5fe4aac (patch)
treecb91185a9952e5daac49b66607e95f739e9ea94e /bin/build-all.sh
parentrenamed cfg.h -> anduril.h inside source files (diff)
downloadanduril-82013a73328ca6e2901d58661e37ccc9b5fe4aac.tar.gz
anduril-82013a73328ca6e2901d58661e37ccc9b5fe4aac.tar.bz2
anduril-82013a73328ca6e2901d58661e37ccc9b5fe4aac.zip
fixed compile scripts and added a "./make" wrapper for convenience
(instead of a Makefile, which isn't really needed for this project)
Diffstat (limited to 'bin/build-all.sh')
-rwxr-xr-xbin/build-all.sh25
1 files changed, 17 insertions, 8 deletions
diff --git a/bin/build-all.sh b/bin/build-all.sh
index e91280a..e3888fb 100755
--- a/bin/build-all.sh
+++ b/bin/build-all.sh
@@ -4,14 +4,17 @@
# If pattern given, only build targets which match.
if [ ! -z "$1" ]; then
- SEARCH="$1"
+ # multiple search terms with "AND"
+ SEARCH=$@
fi
-# TODO: detect UI from $0
+# TODO: detect UI from $0 and/or $*
UI=anduril
mkdir -p hex
+# TODO: use a git tag for the version, instead of build date
+# TODO: use build/version.h instead of $UI/version.h ?
date '+#define VERSION_NUMBER "%Y-%m-%d"' > ui/$UI/version.h
PASS=0
@@ -19,17 +22,22 @@ FAIL=0
PASSED=''
FAILED=''
-for TARGET in $(find hw/*/* -name "$UI".h) ; do
+# build targets are hw/*/**/$UI.h
+for TARGET in $( find hw/*/*/ -name "$UI".h ) ; do
- # maybe limit builds to a specific pattern
+ # limit builds to searched patterns, if given
+ SKIP=0
if [ ! -z "$SEARCH" ]; then
- echo "$TARGET" | grep -i "$SEARCH" > /dev/null
- if [ 0 != $? ]; then continue ; fi
+ for text in $SEARCH ; do
+ echo "$TARGET" | grep -i "$text" > /dev/null
+ if [ 0 != $? ]; then SKIP=1 ; fi
+ done
fi
+ if [ 1 = $SKIP ]; then continue ; fi
# friendly name for this build
NAME=$(echo "$TARGET" | perl -ne 's|/|-|g; /hw-(.*)-'"$UI"'.h/ && print "$1\n";')
- echo "===== $NAME ====="
+ echo "===== $UI : $NAME ====="
# figure out MCU type
#ATTINY=$(grep 'ATTINY:' $TARGET | awk '{ print $3 }')
@@ -37,11 +45,12 @@ for TARGET in $(find hw/*/* -name "$UI".h) ; do
# try to compile
#echo bin/build.sh "$UI" "$TARGET"
- bin/build.sh "$UI" "$TARGET"
+ bin/build.sh "$TARGET"
# track result, and rename compiled files
if [ 0 = $? ] ; then
mv -f "ui/$UI/$UI".hex hex/"$UI".$NAME.hex
+ echo " > hex/$UI.$NAME.hex"
PASS=$(($PASS + 1))
PASSED="$PASSED $NAME"
else