set PATH=%~dp0mingw64\bin;%~dp0python3;%~dp0PortableGit\bin

@echo off
rem Give python the correct paths
rem Other methods don't work reliably (like setting parameters)
echo python313.zip                                   > %~dp0python3\python313._pth
echo .                                              >> %~dp0python3\python313._pth
echo %~dp0mbedtls/scripts                           >> %~dp0python3\python313._pth
echo %~dp0mbedtls/framework                         >> %~dp0python3\python313._pth
echo %~dp0mbedtls/tf-psa-crypto/framework/scripts   >> %~dp0python3\python313._pth

cd mbedtls
rd /s /q build 2>nul
mkdir build
cd build
cmake -G "MinGW Makefiles" ^
      -DCMAKE_BUILD_TYPE=Release ^
      -DGEN_FILES=OFF ^
      -DENABLE_TESTING=OFF ^
      -DENABLE_PROGRAMS=OFF ^
      ..
cmake --build ..\build

cd ..
cd ..


