gen_pack.bat 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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\Include\*.*
  37. XCOPY /Q /S /Y ..\..\CMSIS\Core\Template\ARMv8-M\*.* %RELEASE_PATH%\CMSIS\Core\Template\ARMv8-M\*.*
  38. XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Include\*.* %RELEASE_PATH%\CMSIS\Core_A\Include\*.*
  39. XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Source\*.* %RELEASE_PATH%\CMSIS\Core_A\Source\*.*
  40. :: -- DAP files
  41. XCOPY /Q /S /Y ..\..\CMSIS\DAP\*.* %RELEASE_PATH%\CMSIS\DAP\*.*
  42. :: -- Driver files
  43. XCOPY /Q /S /Y ..\..\CMSIS\Driver\*.* %RELEASE_PATH%\CMSIS\Driver\*.*
  44. :: -- DSP files
  45. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
  46. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
  47. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
  48. XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Examples\*.*
  49. :: -- DSP libraries
  50. XCOPY /Q /S /Y ..\..\CMSIS\Lib\ARM\*.lib %RELEASE_PATH%\CMSIS\Lib\ARM\*.*
  51. XCOPY /Q /S /Y ..\..\CMSIS\Lib\GCC\*.a %RELEASE_PATH%\CMSIS\Lib\GCC\*.*
  52. :: -- NN files
  53. XCOPY /Q /S /Y ..\..\CMSIS\NN\*.* %RELEASE_PATH%\CMSIS\NN\*.*
  54. :: -- Pack files
  55. XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
  56. XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
  57. :: -- RTOS files
  58. XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
  59. XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
  60. :: -- RTOS2 files
  61. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
  62. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Source\*.* %RELEASE_PATH%\CMSIS\RTOS2\Source\*.*
  63. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
  64. XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
  65. :: -- SVD files
  66. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
  67. :: -- Utilities files
  68. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
  69. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
  70. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
  71. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.4.4\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.4.4\*.*
  72. XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.8.3\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.8.3\*.*
  73. :: -- index file
  74. REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
  75. :: Generate Documentation
  76. :: -- Generate doxygen files
  77. PUSHD ..\DoxyGen
  78. :: -- Delete previous generated HTML files
  79. ECHO.
  80. ECHO Delete previous generated HTML files
  81. PUSHD ..\Documentation
  82. FOR %%A IN (Core, Core_A, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
  83. POPD
  84. :: -- Generate HTML Files
  85. ECHO.
  86. ECHO Generate HTML Files
  87. pushd Core
  88. doxygen core.dxy
  89. popd
  90. pushd Core_A
  91. doxygen core_A.dxy
  92. popd
  93. pushd DAP
  94. doxygen dap.dxy
  95. popd
  96. pushd Driver
  97. doxygen Driver.dxy
  98. popd
  99. pushd DSP
  100. doxygen dsp.dxy
  101. popd
  102. pushd General
  103. doxygen general.dxy
  104. popd
  105. pushd NN
  106. doxygen nn.dxy
  107. popd
  108. pushd Pack
  109. doxygen Pack.dxy
  110. popd
  111. pushd RTOS
  112. doxygen rtos.dxy
  113. popd
  114. pushd RTOS2
  115. doxygen rtos.dxy
  116. popd
  117. pushd SVD
  118. doxygen svd.dxy
  119. popd
  120. pushd Zone
  121. doxygen zone.dxy
  122. popd
  123. :: -- Copy search style sheet
  124. ECHO.
  125. ECHO Copy search style sheets
  126. copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
  127. copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
  128. REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
  129. copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
  130. REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
  131. copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
  132. copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
  133. copy /Y Doxygen_Templates\search.css ..\Documentation\NN\html\search\.
  134. ECHO.
  135. POPD
  136. :: -- Copy generated doxygen files
  137. XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
  138. :: -- Remove generated doxygen files
  139. PUSHD ..\Documentation
  140. FOR %%A IN (Core, Core_A, DAP, Driver, DSP, General, NN, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
  141. POPD
  142. :: Checking
  143. Win32\PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353 -x M364
  144. :: --Check if PackChk.exe has completed successfully
  145. IF %errorlevel% neq 0 GOTO ErrPackChk
  146. :: Packing
  147. PUSHD %RELEASE_PATH%
  148. :: -- Pipe Pack's Name into Variable
  149. SET /P PackName=<PackName.txt
  150. DEL /Q PackName.txt
  151. :: Pack files
  152. ECHO Creating pack file ...
  153. 7z.exe a %PackName% -tzip > zip.log
  154. ECHO Packaging complete
  155. POPD
  156. GOTO End
  157. :ErrPackChk
  158. ECHO PackChk.exe has encountered an error!
  159. EXIT /b
  160. :End
  161. ECHO Removing temporary files and folders
  162. RMDIR /Q /S %RELEASE_PATH%\CMSIS
  163. RMDIR /Q /S %RELEASE_PATH%\Device
  164. DEL %RELEASE_PATH%\LICENSE.txt
  165. DEL %RELEASE_PATH%\zip.log
  166. ECHO gen_pack.bat completed successfully