@echo off
::Keil执行文件位置
set keil_tool=%KEIL_TOOL%
if "%keil_tool%"=="" (
echo ERROR: Keil tool chain not found, exit.
exit /B 1
)
:Step1
echo -----------------------------------------------
echo please select product to build
echo 0 CLEAN ALL
echo 1 Debug
echo 2 Release
echo q EXIT
set /p target=:
rem
if %target%==0 (
del /q /s .\Listings\* .\Objects\*
goto Step1
) else if %target%==1 (
set prj_target="Target_D"
) else if %target%==2 (
set prj_target="Target_R"
) else if %target%==q (
exit
) else if %target%==Q (
exit
)
set UV=%keil_tool%
set UV_PRO_FILE="uvprojx"
set UV_PRO_DIR=%cd%
for /f "usebackq delims=" %%j in (`dir /b "%UV_PRO_DIR%"\*."%UV_PRO_FILE%"`) do (
if exis