#!/bin/sh
set -eu
cd "$(dirname "$0")"
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
clang -std=c11 -O2 -Wall -Wextra -Werror -fsanitize=address,undefined -Icontrol control/pressure_decode.c test/test_decode.c -o "$tmp/test"
"$tmp/test"
arm-none-eabi-gcc -std=c11 -Os -Wall -Wextra -Werror -ffreestanding -mcpu=cortex-m0plus -mthumb -Icontrol -c control/pressure_decode.c -o "$tmp/decoder.o"
arm-none-eabi-size "$tmp/decoder.o"
arm-none-eabi-nm -u "$tmp/decoder.o"
