p≡p engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.5 KiB

2 years ago
1 year ago
  1. @ECHO OFF
  2. :: The script is located in ...\pEpForWindowsAdapterSolution\pEpEngine\build-windows\
  3. SET current_directory=%~dp0
  4. :: Engine directory is ...\pEpForWindowsAdapterSolution\pEpEngine\
  5. SET engine_directory=%current_directory:~0,-14%
  6. :: YML2 directory is ...\pEpForWindowsAdapterSolution\yml2\
  7. SET yml2_directory=%engine_directory:~0,-11%\yml2
  8. :: Create the system.db
  9. PUSHD %engine_directory%\db
  10. CALL make_systemdb
  11. IF NOT EXIST "%ProgramData%\pEp" "MKDIR %ProgramData%\pEp"
  12. DEL "%ProgramData%\pEp\system.db"
  13. MOVE system.db "%ProgramData%\pEp\system.db"
  14. :: Generate code in ...\pEpEngine\sync
  15. CD ..\sync
  16. :: Make sure YML2 is installed
  17. PY -m pip install wheel
  18. PY -m pip install yml2
  19. :: Generate the Sync code
  20. IF NOT EXIST generated MKDIR generated
  21. ECHO PY -m yml2.yml2proc -E utf-8 -y gen_actions.ysl2 sync.fsm
  22. PY -m yml2.yml2proc -E utf-8 -y gen_actions.ysl2 sync.fsm
  23. IF %ERRORLEVEL% NEQ 0 GOTO end
  24. ECHO PY -m yml2.yml2proc -E utf-8 -y gen_codec.ysl2 distribution.fsm
  25. PY -m yml2.yml2proc -E utf-8 -y gen_codec.ysl2 distribution.fsm
  26. IF %ERRORLEVEL% NEQ 0 GOTO end
  27. ECHO PY -m yml2.yml2proc -E utf-8 -y gen_codec.ysl2 sync.fsm
  28. PY -m yml2.yml2proc -E utf-8 -y gen_codec.ysl2 sync.fsm
  29. IF %ERRORLEVEL% NEQ 0 GOTO end
  30. ECHO PY -m yml2.yml2proc -E utf-8 -y gen_messages.ysl2 sync.fsm
  31. PY -m yml2.yml2proc -E utf-8 -y gen_messages.ysl2 sync.fsm
  32. IF %ERRORLEVEL% NEQ 0 GOTO end
  33. ECHO PY -m yml2.yml2proc -E utf-8 -y gen_messages.ysl2 distribution.fsm
  34. PY -m yml2.yml2proc -E utf-8 -y gen_messages.ysl2 distribution.fsm
  35. IF %ERRORLEVEL% NEQ 0 GOTO end
  36. ECHO PY -m yml2.yml2proc -E utf-8 -y gen_message_func.ysl2 sync.fsm
  37. PY -m yml2.yml2proc -E utf-8 -y gen_message_func.ysl2 sync.fsm
  38. IF %ERRORLEVEL% NEQ 0 GOTO end
  39. ECHO PY -m yml2.yml2proc -E utf-8 -y gen_statemachine.ysl2 sync.fsm
  40. PY -m yml2.yml2proc -E utf-8 -y gen_statemachine.ysl2 sync.fsm
  41. IF %ERRORLEVEL% NEQ 0 GOTO end
  42. XCOPY /y generated\*.asn1 ..\asn.1\
  43. XCOPY /y generated\*.c ..\src\
  44. XCOPY /y generated\*.h ..\src\
  45. CD %engine_directory%\asn.1
  46. DEL *.h
  47. DEL *.c
  48. ..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 sync.asn1
  49. IF %ERRORLEVEL% NEQ 0 GOTO end
  50. ..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keyreset.asn1 distribution.asn1
  51. IF %ERRORLEVEL% NEQ 0 GOTO end
  52. DEL *-sample.c
  53. CD %engine_directory%\..
  54. RD /S/Q pEp
  55. MKDIR pEp
  56. XCOPY pEpEngine\src\*.h pEp\ /Y/F/I
  57. :end
  58. POPD
  59. EXIT /B %ERRORLEVEL%