blob: 682c2c98af1340be862dfc21905dab64d01f5a16 [file] [log] [blame]
Martin Günther89be6522016-05-13 07:57:31 +02001:: Batch file for generating CMSIS pack
2:: This batch file uses:
Joachim Krech347ff5a2016-05-13 08:56:15 +02003:: 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)
Martin Günther89be6522016-05-13 07:57:31 +02006@ECHO off
7
8SETLOCAL
9
10:: Tool path for zipping tool 7-Zip
11SET ZIPPATH=C:\Program Files\7-Zip
12
13:: Tool path for doxygen
14SET DOXYGENPATH=C:\Program Files\doxygen\bin
15
16:: Tool path for mscgen utility
17SET MSCGENPATH=C:\Program Files (x86)\Mscgen
Martin Günther89be6522016-05-13 07:57:31 +020018:: These settings should be passed on to subprocesses as well
19SET PATH=%ZIPPATH%;%DOXYGENPATH%;%MSCGENPATH%;%PATH%
20
21:: Pack Path (where generated pack is stored)
22SET RELEASE_PATH=..\..\Local_Release
23
Joachim Krech347ff5a2016-05-13 08:56:15 +020024:: !!!!!!!!!!!!!!!!!
25:: DO NOT EDIT BELOW
26:: !!!!!!!!!!!!!!!!!
Martin Günther89be6522016-05-13 07:57:31 +020027
28:: Remove previous build
29IF EXIST %RELEASE_PATH% (
30 ECHO removing %RELEASE_PATH%
31 RMDIR /Q /S %RELEASE_PATH%
32)
33
34:: Create build output directory
35MKDIR %RELEASE_PATH%
36
Joachim Krech347ff5a2016-05-13 08:56:15 +020037
Martin Günther89be6522016-05-13 07:57:31 +020038:: Copy PDSC file
39COPY ..\..\ARM.CMSIS.pdsc %RELEASE_PATH%\ARM.CMSIS.pdsc
40
Joachim Krech347ff5a2016-05-13 08:56:15 +020041:: Copy LICENSE file
Joachim Krech77988a22016-11-07 17:15:07 +010042COPY ..\..\LICENSE.txt %RELEASE_PATH%\LICENSE.txt
Joachim Krech347ff5a2016-05-13 08:56:15 +020043
Martin Günther89be6522016-05-13 07:57:31 +020044:: Copy Device folder
45XCOPY /Q /S /Y ..\..\Device\*.* %RELEASE_PATH%\Device\*.*
46
47:: Copy CMSIS folder
48:: -- Core files
Jonatan Antoniba9cdf32018-06-29 15:22:59 +020049XCOPY /Q /S /Y ..\..\CMSIS\Core\Include\*.* %RELEASE_PATH%\CMSIS\Core\Include\*.*
Jonatan Antoni648ac2c2019-03-18 12:07:41 +010050XCOPY /Q /S /Y ..\..\CMSIS\Core\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
Christopher Seidl2e8b8142016-10-25 16:29:05 +020051XCOPY /Q /S /Y ..\..\CMSIS\Core\Template\ARMv8-M\*.* %RELEASE_PATH%\CMSIS\Core\Template\ARMv8-M\*.*
brondanib6bdb2c2017-03-02 16:15:52 +010052XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Include\*.* %RELEASE_PATH%\CMSIS\Core_A\Include\*.*
Vladimir Umek4df83f82017-07-03 09:36:49 +020053XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Source\*.* %RELEASE_PATH%\CMSIS\Core_A\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020054
55:: -- DAP files
56XCOPY /Q /S /Y ..\..\CMSIS\DAP\*.* %RELEASE_PATH%\CMSIS\DAP\*.*
57
58:: -- Driver files
59XCOPY /Q /S /Y ..\..\CMSIS\Driver\*.* %RELEASE_PATH%\CMSIS\Driver\*.*
60
61:: -- DSP files
Jonatan Antoni2620d732020-03-17 16:07:31 +010062XCOPY /Q /S /Y ..\..\CMSIS\DSP\ComputeLibrary\*.* %RELEASE_PATH%\CMSIS\DSP\ComputeLibrary\*.*
Jonatan Antoni9feb2b22019-03-15 14:54:08 +010063XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\DSP\Include\*.*
Jonatan Antoni648ac2c2019-03-18 12:07:41 +010064XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
Jonatan Antoni2620d732020-03-17 16:07:31 +010065XCOPY /Q /S /Y ..\..\CMSIS\DSP\PrivateInclude\*.* %RELEASE_PATH%\CMSIS\DSP\PrivateInclude\*.*
Jonatan Antoni9feb2b22019-03-15 14:54:08 +010066XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP\Source\*.*
67XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP\Projects\*.*
68XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP\Examples\*.*
Jonatan Antonif35c2902019-03-15 15:32:28 +010069XCOPY /Q /S /Y ..\..\CMSIS\DSP\Lib\*.* %RELEASE_PATH%\CMSIS\DSP\Lib\*.*
Martin Günther89be6522016-05-13 07:57:31 +020070
Jonatan Antonia67f5552018-01-18 15:22:46 +010071:: -- NN files
72XCOPY /Q /S /Y ..\..\CMSIS\NN\*.* %RELEASE_PATH%\CMSIS\NN\*.*
73
Martin Günther89be6522016-05-13 07:57:31 +020074:: -- Pack files
Joachim Krech347ff5a2016-05-13 08:56:15 +020075XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
Martin Günther89be6522016-05-13 07:57:31 +020076XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
77
78:: -- RTOS files
79XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
80XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
81
82:: -- RTOS2 files
Robert Rostohareefdc5a2016-07-05 07:25:38 +020083XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
Robert Rostohar04fa90a2017-06-09 13:22:27 +020084XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Source\*.* %RELEASE_PATH%\CMSIS\RTOS2\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020085XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
Robert Rostohardab42a22016-07-01 23:23:16 +020086XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
Martin Günther89be6522016-05-13 07:57:31 +020087
88:: -- SVD files
89XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
90
91:: -- Utilities files
Martin Günther96143552016-09-28 13:30:22 +020092XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
93XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
Joachim Krechc97ec682018-03-06 12:17:28 +010094XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PackIndex.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
95
Martin Günther96143552016-09-28 13:30:22 +020096XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
97XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.4.4\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.4.4\*.*
98XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.8.3\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.8.3\*.*
Martin Günther89be6522016-05-13 07:57:31 +020099
Joachim Krech347ff5a2016-05-13 08:56:15 +0200100:: -- index file
Martin Günther96143552016-09-28 13:30:22 +0200101REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
Martin Günther89be6522016-05-13 07:57:31 +0200102
103:: Generate Documentation
104:: -- Generate doxygen files
105PUSHD ..\DoxyGen
106
107:: -- Delete previous generated HTML files
108ECHO.
109ECHO Delete previous generated HTML files
110
111PUSHD ..\Documentation
Jonatan Antoni2620d732020-03-17 16:07:31 +0100112FOR %%A IN (Build, Core, Core_A, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
Martin Günther89be6522016-05-13 07:57:31 +0200113POPD
114
115:: -- Generate HTML Files
116ECHO.
117ECHO Generate HTML Files
118
Jonatan Antoni2620d732020-03-17 16:07:31 +0100119pushd Build
120doxygen Build.dxy
121popd
122
Martin Günther89be6522016-05-13 07:57:31 +0200123pushd Core
124doxygen core.dxy
125popd
126
Joachim Krecha92f9912017-03-10 17:08:23 +0100127pushd Core_A
128doxygen core_A.dxy
129popd
130
Martin Günther89be6522016-05-13 07:57:31 +0200131pushd DAP
132doxygen dap.dxy
133popd
134
135pushd Driver
136doxygen Driver.dxy
137popd
138
139pushd DSP
140doxygen dsp.dxy
141popd
142
143pushd General
144doxygen general.dxy
145popd
146
Jonatan Antonia67f5552018-01-18 15:22:46 +0100147pushd NN
148doxygen nn.dxy
149popd
150
Martin Günther89be6522016-05-13 07:57:31 +0200151pushd Pack
152doxygen Pack.dxy
153popd
154
155pushd RTOS
156doxygen rtos.dxy
157popd
158
159pushd RTOS2
160doxygen rtos.dxy
161popd
162
163pushd SVD
164doxygen svd.dxy
165popd
166
Joachim Krecha92f9912017-03-10 17:08:23 +0100167pushd Zone
168doxygen zone.dxy
169popd
170
Martin Günther89be6522016-05-13 07:57:31 +0200171:: -- Copy search style sheet
172ECHO.
173ECHO Copy search style sheets
Jonatan Antoni2620d732020-03-17 16:07:31 +0100174copy /Y Doxygen_Templates\search.css ..\Documentation\Build\html\search\.
175copy /Y Doxygen_Templates\search.css ..\Documentation\Core\html\search\.
176copy /Y Doxygen_Templates\search.css ..\Documentation\Core_A\html\search\.
Martin Günther89be6522016-05-13 07:57:31 +0200177copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
178REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
179copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
180REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
181copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
182copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
Jonatan Antonia67f5552018-01-18 15:22:46 +0100183copy /Y Doxygen_Templates\search.css ..\Documentation\NN\html\search\.
Jonatan Antoni661ead82018-02-22 10:12:48 +0100184
Martin Günther89be6522016-05-13 07:57:31 +0200185ECHO.
186POPD
187
188:: -- Copy generated doxygen files
189XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
190
191:: -- Remove generated doxygen files
192PUSHD ..\Documentation
Jonatan Antoni2620d732020-03-17 16:07:31 +0100193FOR %%A IN (Build, Core, Core_A, DAP, Driver, DSP, General, NN, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
Martin Günther89be6522016-05-13 07:57:31 +0200194POPD
195
Martin Günther89be6522016-05-13 07:57:31 +0200196:: Checking
Jonatan Antonie6182fe2019-07-03 14:12:52 +0200197Win32\PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353 -x M364 -x M335
Martin Günther89be6522016-05-13 07:57:31 +0200198
199:: --Check if PackChk.exe has completed successfully
200IF %errorlevel% neq 0 GOTO ErrPackChk
201
Martin Günther89be6522016-05-13 07:57:31 +0200202:: Packing
203PUSHD %RELEASE_PATH%
204
205:: -- Pipe Pack's Name into Variable
Joachim Krech347ff5a2016-05-13 08:56:15 +0200206SET /P PackName=<PackName.txt
207DEL /Q PackName.txt
Martin Günther89be6522016-05-13 07:57:31 +0200208
209:: Pack files
Joachim Krechc6316a62016-11-10 09:46:05 +0100210ECHO Creating pack file ...
Joachim Krech164a9202020-01-31 09:11:32 +01002117z.exe a %PackName% -tzip > NUL:
Joachim Krechc6316a62016-11-10 09:46:05 +0100212ECHO Packaging complete
Martin Günther89be6522016-05-13 07:57:31 +0200213POPD
214GOTO End
215
Martin Günther89be6522016-05-13 07:57:31 +0200216:ErrPackChk
217ECHO PackChk.exe has encountered an error!
218EXIT /b
219
220:End
Joachim Krechc6316a62016-11-10 09:46:05 +0100221ECHO Removing temporary files and folders
Martin Günther89be6522016-05-13 07:57:31 +0200222RMDIR /Q /S %RELEASE_PATH%\CMSIS
223RMDIR /Q /S %RELEASE_PATH%\Device
Joachim Krech7e3c7732016-11-07 17:16:31 +0100224DEL %RELEASE_PATH%\LICENSE.txt
Martin Günther89be6522016-05-13 07:57:31 +0200225
Joachim Krechc6316a62016-11-10 09:46:05 +0100226ECHO gen_pack.bat completed successfully