Append Git commit hash to firmware BIN filename

This commit is contained in:
2026-09-22 12:56:45 +03:00
parent ee7dce4615
commit 2a9f42331c
5 changed files with 34 additions and 9 deletions

16
build_bin.bat Normal file
View File

@@ -0,0 +1,16 @@
@echo off
setlocal
set "SRC_ROOT=%~dp0"
set "GIT_COMMIT="
for /f "delims=" %%H in ('git -C "%SRC_ROOT%." rev-parse --short^=8 HEAD') do set "GIT_COMMIT=%%H"
if not defined GIT_COMMIT (
echo ERROR: Cannot determine the Git commit. Make Git available in PATH. 1>&2
exit /b 1
)
pushd "%SRC_ROOT%Bin" || exit /b 1
hex2000.exe UKSSTMS320F28335.out -boot -sci8 -map UKSSTMS320F28335.map -o UKSSTMS320F28335_%GIT_COMMIT%.bin -b
set "BUILD_RESULT=%errorlevel%"
popd
exit /b %BUILD_RESULT%