gen_pack.bat 5.3 KB

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