gen_pack.bat 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. :: Batch file for generating CMSIS pack
  2. :: This batch file uses:
  3. :: 7-Zip for packaging
  4. :: Doxygen version 1.8.2 and Mscgen version 0.20 for generating html documentation.
  5. :: The generated pack and pdsc file are placed in folder %RELEASE_PATH% (../../Local_Release)
  6. @ECHO off
  7. SETLOCAL
  8. :: Tool path for zipping tool 7-Zip
  9. SET ZIPPATH=C:\Program Files\7-Zip
  10. :: Tool path for doxygen
  11. SET DOXYGENPATH=C:\Program Files\doxygen\bin
  12. :: Tool path for mscgen utility
  13. SET MSCGENPATH=C:\Program Files (x86)\Mscgen
  14. :: These settings should be passed on to subprocesses as well
  15. SET PATH=%ZIPPATH%;%DOXYGENPATH%;%MSCGENPATH%;%PATH%
  16. :: Pack Path (where generated pack is stored)
  17. SET RELEASE_PATH=..\..\Local_Release
  18. :: !!!!!!!!!!!!!!!!!
  19. :: DO NOT EDIT BELOW
  20. :: !!!!!!!!!!!!!!!!!
  21. :: Remove previous build
  22. IF EXIST %RELEASE_PATH% (
  23. ECHO removing %RELEASE_PATH%
  24. RMDIR /Q /S %RELEASE_PATH%
  25. )
  26. :: Create build output directory
  27. MKDIR %RELEASE_PATH%
  28. :: Copy PDSC file
  29. COPY ..\..\ARM.CMSIS.pdsc %RELEASE_PATH%\ARM.CMSIS.pdsc
  30. :: Copy LICENSE file
  31. COPY ..\..\LICENSE.txt %RELEASE_PATH%\LICENSE.txt
  32. :: Copy Device folder
  33. XCOPY /Q /S /Y ..\..\Device\*.* %RELEASE_PATH%\Device\*.*
  34. :: Copy CMSIS folder
  35. :: -- Core files
  36. XCOPY /Q /S /Y ..\..\CMSIS\Core\Include\*.* %RELEASE_PATH%\CMSIS\Core\Include\*.*
  37. XCOPY /Q /S /Y ..\..\CMSIS\Core\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
  38. XCOPY /Q /S /Y ..\..\CMSIS\Core\Template\ARMv8-M\*.* %RELEASE_PATH%\CMSIS\Core\Template\ARMv8-M\*.*
  39. XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Include\*.* %RELEASE_PATH%\CMSIS\Core_A\Include\*.*
  40. XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Source\*.* %RELEASE_PATH%\CMSIS\Core_A\Source\*.*
  41. :: -- DAP files
  42. XCOPY /Q /S /Y ..\..\CMSIS\DAP\*.* %RELEASE_PATH%\CMSIS\DAP\*.*
  43. :: -- Driver files
  44. XCOPY /Q /S /Y ..\..\CMSIS\Driver\*.* %RELEASE_PATH%\CMSIS\Driver\*.*
  45. :: -- DSP files
  46. XCOPY /Q /S /Y ..\..\CMSIS\DSP\ComputeLibrary\*.* %RELEASE_PATH%\CMSIS\DSP\ComputeLibrary\*.*
  47. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\DSP\Include\*.*
  48. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
  49. XCOPY /Q /S /Y ..\..\CMSIS\DSP\PrivateInclude\*.* %RELEASE_PATH%\CMSIS\DSP\PrivateInclude\*.*
  50. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP\Source\*.*
  51. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP\Projects\*.*
  52. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP\Examples\*.*
  53. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Lib\*.* %RELEASE_PATH%\CMSIS\DSP\Lib\*.*
  54. :: -- NN files
  55. XCOPY /Q /S /Y ..\..\CMSIS\NN\*.* %RELEASE_PATH%\CMSIS\NN\*.*
  56. :: -- Pack files
  57. XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
  58. XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
  59. :: -- RTOS files
  60. XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
  61. XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
  62. :: -- RTOS2 files
  63. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
  64. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Source\*.* %RELEASE_PATH%\CMSIS\RTOS2\Source\*.*
  65. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
  66. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
  67. :: -- SVD files
  68. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
  69. :: -- Utilities files
  70. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
  71. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
  72. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PackIndex.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
  73. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
  74. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux64\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux64\*.*
  75. :: -- index file
  76. REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
  77. :: Generate Documentation
  78. :: -- Generate doxygen files
  79. PUSHD ..\DoxyGen
  80. :: -- Delete previous generated HTML files
  81. ECHO.
  82. ECHO Delete previous generated HTML files
  83. PUSHD ..\Documentation
  84. FOR %%A IN (Build, Core, Core_A, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
  85. POPD
  86. :: -- Generate HTML Files
  87. ECHO.
  88. ECHO Generate HTML Files
  89. pushd Build
  90. doxygen Build.dxy
  91. popd
  92. pushd Core
  93. doxygen core.dxy
  94. popd
  95. pushd Core_A
  96. doxygen core_A.dxy
  97. popd
  98. pushd DAP
  99. doxygen dap.dxy
  100. popd
  101. pushd Driver
  102. doxygen Driver.dxy
  103. popd
  104. pushd DSP
  105. doxygen dsp.dxy
  106. popd
  107. pushd General
  108. doxygen general.dxy
  109. popd
  110. pushd NN
  111. doxygen nn.dxy
  112. popd
  113. pushd Pack
  114. doxygen Pack.dxy
  115. popd
  116. pushd RTOS
  117. doxygen rtos.dxy
  118. popd
  119. pushd RTOS2
  120. doxygen rtos.dxy
  121. popd
  122. pushd SVD
  123. doxygen svd.dxy
  124. popd
  125. pushd Zone
  126. doxygen zone.dxy
  127. popd
  128. :: -- Copy search style sheet
  129. ECHO.
  130. ECHO Copy search style sheets
  131. copy /Y Doxygen_Templates\search.css ..\Documentation\Build\html\search\.
  132. copy /Y Doxygen_Templates\search.css ..\Documentation\Core\html\search\.
  133. copy /Y Doxygen_Templates\search.css ..\Documentation\Core_A\html\search\.
  134. copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
  135. REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
  136. copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
  137. REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
  138. copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
  139. copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
  140. copy /Y Doxygen_Templates\search.css ..\Documentation\NN\html\search\.
  141. ECHO.
  142. POPD
  143. :: -- Copy generated doxygen files
  144. XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
  145. :: -- Remove generated doxygen files
  146. PUSHD ..\Documentation
  147. FOR %%A IN (Build, Core, Core_A, DAP, Driver, DSP, General, NN, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
  148. POPD
  149. :: Checking
  150. Win32\PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353 -x M364 -x M335
  151. :: --Check if PackChk.exe has completed successfully
  152. IF %errorlevel% neq 0 GOTO ErrPackChk
  153. :: Packing
  154. PUSHD %RELEASE_PATH%
  155. :: -- Pipe Pack's Name into Variable
  156. SET /P PackName=<PackName.txt
  157. DEL /Q PackName.txt
  158. :: Pack files
  159. ECHO Creating pack file ...
  160. 7z.exe a %PackName% -tzip > NUL:
  161. ECHO Packaging complete
  162. POPD
  163. GOTO End
  164. :ErrPackChk
  165. ECHO PackChk.exe has encountered an error!
  166. EXIT /b
  167. :End
  168. ECHO Removing temporary files and folders
  169. RMDIR /Q /S %RELEASE_PATH%\CMSIS
  170. RMDIR /Q /S %RELEASE_PATH%\Device
  171. DEL %RELEASE_PATH%\LICENSE.txt
  172. ECHO gen_pack.bat completed successfully