Skip to content

Commit

Permalink
Add script to automate generating binaries for all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
augustofg committed Jul 19, 2023
1 parent d85e5f8 commit 1314d68
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions scripts/make-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/sh

openmmc_root=$(realpath ..)
afc_timing_build_dir="${openmmc_root}/build/releases/afcv3.1-timing"
afc_bpm_build_dir="${openmmc_root}/build/releases/afcv3.1-bpm"
afc_v4_build_dir="${openmmc_root}/build/releases/afcv4"
bin_dir="${openmmc_root}/build/releases/binaries"
tag=$(git describe --tags)

set -e

rm -rf "${openmmc_root}/build/releases/"
mkdir -p "$bin_dir"
mkdir -p "$afc_timing_build_dir"
mkdir -p "$afc_bpm_build_dir"
mkdir -p "$afc_v4_build_dir"

cd "$afc_timing_build_dir"
cmake "$openmmc_root" -DBOARD=afc-timing -DBOARD_RTM=8sfp -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_WATCHDOG=OFF
make

cd "$afc_bpm_build_dir"
cmake "$openmmc_root" -DBOARD=afc-bpm -DVERSION=3.1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_WATCHDOG=OFF
make

cd "$afc_v4_build_dir"
cmake "$openmmc_root" -DBOARD=afc-v4 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_WATCHDOG=OFF
make

cp "${afc_timing_build_dir}/out/openMMC.elf" "${bin_dir}/openMMC-afcv3.1-timing-${tag}.elf"
cp "${afc_timing_build_dir}/out/openMMC.bin" "${bin_dir}/openMMC-afcv3.1-timing-${tag}.bin"
cp "${afc_timing_build_dir}/out/openMMC.hpm" "${bin_dir}/openMMC-afcv3.1-timing-${tag}.hpm"

cp "${afc_bpm_build_dir}/out/openMMC.elf" "${bin_dir}/openMMC-afcv3.1-bpm-${tag}.elf"
cp "${afc_bpm_build_dir}/out/openMMC.bin" "${bin_dir}/openMMC-afcv3.1-bpm-${tag}.bin"
cp "${afc_bpm_build_dir}/out/openMMC.hpm" "${bin_dir}/openMMC-afcv3.1-bpm-${tag}.hpm"

cp "${afc_bpm_build_dir}/out/newboot.elf" "${bin_dir}/newboot-afcv3.1-${tag}.elf"
cp "${afc_bpm_build_dir}/out/newboot.bin" "${bin_dir}/newboot-afcv3.1-${tag}.bin"
cp "${afc_bpm_build_dir}/out/newboot.hpm" "${bin_dir}/newboot-afcv3.1-${tag}.hpm"

cp "${afc_v4_build_dir}/out/openMMC.elf" "${bin_dir}/openMMC-afcv4-${tag}.elf"
cp "${afc_v4_build_dir}/out/openMMC.bin" "${bin_dir}/openMMC-afcv4-${tag}.bin"
cp "${afc_v4_build_dir}/out/openMMC.hpm" "${bin_dir}/openMMC-afcv4-${tag}.hpm"

cp "${afc_v4_build_dir}/out/newboot.elf" "${bin_dir}/newboot-afcv4-${tag}.elf"
cp "${afc_v4_build_dir}/out/newboot.bin" "${bin_dir}/newboot-afcv4-${tag}.bin"
cp "${afc_v4_build_dir}/out/newboot.hpm" "${bin_dir}/newboot-afcv4-${tag}.hpm"

cd "${bin_dir}"
sha256sum * > SHA256SUMS

0 comments on commit 1314d68

Please sign in to comment.