aboutsummaryrefslogtreecommitdiff
path: root/bin/build.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.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 '')
-rwxr-xr-xbin/build.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/build.sh b/bin/build.sh
index 0c4fc17..41abfc7 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -4,16 +4,16 @@
# same exact way, here's a script to do the same thing
if [ -z "$1" ]; then
- echo "Usage: build.sh UI CFG USER"
- echo "Example: build.sh ui/anduril hw/hank/emisar-d4 users/myuser"
+ echo "Usage: build.sh TARGET USER"
+ echo "Example: build.sh hw/hank/emisar-d4/anduril.h users/myuser"
echo "(but USER isn't implemented yet)"
exit
fi
-UI=$1 ; shift
-CFG=$1 ; shift
+TARGET=$1 ; shift
+UI=$(basename $TARGET .h)
-ATTINY=$(grep 'ATTINY:' $CFG | awk '{ print $3 }')
+ATTINY=$(grep 'ATTINY:' $TARGET | awk '{ print $3 }')
if [ -z "$ATTINY" ]; then ATTINY=85 ; fi
PROGRAM="ui/$UI/$UI"
@@ -45,7 +45,7 @@ export LDFLAGS="-fgnu89-inline"
export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex --remove-section .fuse'
export OBJS=$PROGRAM.o
-OTHERFLAGS="-DCFG_H=$CFG"
+OTHERFLAGS="-DCFG_H=$TARGET"
for arg in "$*" ; do
OTHERFLAGS="$OTHERFLAGS $arg"
done
@@ -64,4 +64,4 @@ run $CC $OFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o
run $OBJCOPY $OBJCOPYFLAGS $PROGRAM.elf $PROGRAM.hex
# deprecated
#run avr-size -C --mcu=$MCU $PROGRAM.elf | grep Full
-run avr-objdump -Pmem-usage $PROGRAM.elf | grep Full
+run avr-objdump -Pmem-usage $PROGRAM.elf | grep -E 'Full|Device' | sed 's/^/ /;'