setup_win.bat 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. @echo off
  2. REM Expect the script at /path/to/wolfssl/IDE/Espressif/ESP-IDF/
  3. if NOT EXIST "setup.sh" (
  4. echo "Please run this script at /path/to/wolfssl/IDE/Espressif/ESP-IDF/
  5. goto exit
  6. )
  7. if "%IDF_PATH%" == "" (
  8. echo "Please launch the script from ESP-IDF command prompt."
  9. goto exit
  10. )
  11. set SCRIPTDIR=%CD%
  12. set BASEDIR=%SCRIPTDIR%\..\..\..\
  13. set WOLFSSL_ESPIDFDIR=%BASEDIR%\IDE\Espressif\ESP-IDF
  14. set WOLFSSLLIB_TRG_DIR=%IDF_PATH%\components\wolfssl
  15. set WOLFSSLEXP_TRG_DIR=%IDF_PATH%\examples\protocols
  16. echo Copy files into $IDF_PATH%
  17. rem Remove/Create directories
  18. rmdir /S/Q %WOLFSSLLIB_TRG_DIR%
  19. mkdir %WOLFSSLLIB_TRG_DIR%
  20. mkdir %WOLFSSLLIB_TRG_DIR%\src
  21. mkdir %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
  22. mkdir %WOLFSSLLIB_TRG_DIR%\wolfssl
  23. mkdir %WOLFSSLLIB_TRG_DIR%\test
  24. mkdir %WOLFSSLLIB_TRG_DIR%\include
  25. rem copying ... files in src/ into $WOLFSSLLIB_TRG_DIR%/src
  26. xcopy /Y/Q %BASEDIR%\src\*.c %WOLFSSLLIB_TRG_DIR%\src\
  27. xcopy /Y/Q %BASEDIR%\wolfcrypt\src\*.c %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
  28. xcopy /Y/Q %BASEDIR%\wolfcrypt\src\*.i %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
  29. xcopy /E/Y/Q %BASEDIR%\wolfcrypt\src\port %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\
  30. xcopy /E/Y/Q %BASEDIR%\wolfcrypt\test\ %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\
  31. xcopy /E/Y/Q %BASEDIR%\wolfcrypt\benchmark\ %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\
  32. xcopy /Y/Q %BASEDIR%\wolfssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\
  33. xcopy /E/Y/Q %BASEDIR%\wolfssl\wolfcrypt\ %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\
  34. rem user_settings.h
  35. xcopy /F/Q %WOLFSSL_ESPIDFDIR%\user_settings.h %WOLFSSLLIB_TRG_DIR%\include\
  36. echo F |xcopy /F/Q %WOLFSSL_ESPIDFDIR%\dummy_config_h %WOLFSSLLIB_TRG_DIR%\include\config.h
  37. rem unit test app
  38. xcopy /E/Y/Q %WOLFSSL_ESPIDFDIR%\test %WOLFSSLLIB_TRG_DIR%\test\
  39. xcopy /F/Q %WOLFSSL_ESPIDFDIR%\libs\CMakeLists.txt %WOLFSSLLIB_TRG_DIR%\
  40. xcopy /F/Q %WOLFSSL_ESPIDFDIR%\libs\component.mk %WOLFSSLLIB_TRG_DIR%\
  41. rem Benchmark program
  42. rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\
  43. mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\main\
  44. xcopy /F/Q %BASEDIR%\wolfcrypt\benchmark\benchmark.c %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\main\
  45. xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_benchmark %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\
  46. rem Crypt Test program
  47. rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_test\
  48. mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_test\main\
  49. xcopy /F/Q %BASEDIR%\wolfcrypt\test\test.c %WOLFSSLEXP_TRG_DIR%\wolfssl_test\main\
  50. xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_test %WOLFSSLEXP_TRG_DIR%\wolfssl_test\
  51. rem TLS Client program
  52. rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_client\
  53. mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_client\main\
  54. xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_client %WOLFSSLEXP_TRG_DIR%\wolfssl_client\
  55. rem TLS Server program
  56. rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_server\
  57. mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_server\main\
  58. xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_server %WOLFSSLEXP_TRG_DIR%\wolfssl_server\
  59. :exit
  60. echo completed