1#!/usr/bin/env bash
2
3function help() {
4  echo "Usage: bash build_espcoredump.sh [OUTPUT_DIR]"
5}
6
7if [ -z "$1" ]; then
8  help
9  exit 1
10else
11  output_dir=$1
12fi
13
14SUPPORTED_TARGETS=("esp32" "esp32s2" "esp32c3" "esp32s3")
15for chip in "${SUPPORTED_TARGETS[@]}"; do
16  {
17    echo "--------------------------"
18    echo "building $chip binaries..."
19    echo "--------------------------"
20    idf.py fullclean && rm -f sdkconfig
21    idf.py set-target $chip
22    idf.py build
23    cp ./build/test_core_dump.elf "${output_dir}/${chip}.elf"
24  }
25done
26