2022-07-14 16:24:26 +00:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
if not [%FBT_ROOT%] == [] (
|
|
|
|
goto already_set
|
|
|
|
)
|
|
|
|
|
|
|
|
set "FBT_ROOT=%~dp0\..\..\"
|
|
|
|
pushd %FBT_ROOT%
|
|
|
|
set "FBT_ROOT=%cd%"
|
|
|
|
popd
|
|
|
|
|
|
|
|
if not [%FBT_NOENV%] == [] (
|
|
|
|
exit /b 0
|
|
|
|
)
|
|
|
|
|
2022-08-02 14:05:31 +00:00
|
|
|
set "FLIPPER_TOOLCHAIN_VERSION=8"
|
2022-07-14 16:24:26 +00:00
|
|
|
set "FBT_TOOLCHAIN_ROOT=%FBT_ROOT%\toolchain\i686-windows"
|
|
|
|
|
|
|
|
|
|
|
|
if not exist "%FBT_TOOLCHAIN_ROOT%" (
|
2022-07-25 21:31:34 +00:00
|
|
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%"
|
2022-07-14 16:24:26 +00:00
|
|
|
)
|
|
|
|
if not exist "%FBT_TOOLCHAIN_ROOT%\VERSION" (
|
2022-07-25 21:31:34 +00:00
|
|
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%"
|
2022-07-14 16:24:26 +00:00
|
|
|
)
|
2022-07-25 21:31:34 +00:00
|
|
|
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_ROOT%\VERSION"
|
2022-07-14 16:24:26 +00:00
|
|
|
if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" (
|
2022-07-25 21:31:34 +00:00
|
|
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%"
|
2022-07-14 16:24:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
set "HOME=%USERPROFILE%"
|
|
|
|
set "PYTHONHOME=%FBT_TOOLCHAIN_ROOT%\python"
|
2022-08-12 09:01:25 +00:00
|
|
|
set "PYTHONPATH="
|
2022-07-14 16:24:26 +00:00
|
|
|
set "PATH=%FBT_TOOLCHAIN_ROOT%\python;%FBT_TOOLCHAIN_ROOT%\bin;%FBT_TOOLCHAIN_ROOT%\protoc\bin;%FBT_TOOLCHAIN_ROOT%\openocd\bin;%PATH%"
|
|
|
|
set "PROMPT=(fbt) %PROMPT%"
|
|
|
|
|
|
|
|
:already_set
|
|
|
|
|
|
|
|
if not "%1" == "env" (
|
|
|
|
echo *********************************
|
|
|
|
echo * fbt build environment *
|
|
|
|
echo *********************************
|
2022-07-25 21:31:34 +00:00
|
|
|
cd "%FBT_ROOT%"
|
2022-07-14 16:24:26 +00:00
|
|
|
cmd /k
|
|
|
|
)
|