blob: d2bc48245f41078084ff5f50ea45731ed7c5d28a [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
18
19:: These settings should be passed on to subprocesses as well
20SET PATH=%ZIPPATH%;%DOXYGENPATH%;%MSCGENPATH%;%PATH%
21
22:: Pack Path (where generated pack is stored)
23SET RELEASE_PATH=..\..\Local_Release
24
Joachim Krech347ff5a2016-05-13 08:56:15 +020025:: !!!!!!!!!!!!!!!!!
26:: DO NOT EDIT BELOW
27:: !!!!!!!!!!!!!!!!!
Martin Günther89be6522016-05-13 07:57:31 +020028
29:: Remove previous build
30IF EXIST %RELEASE_PATH% (
31 ECHO removing %RELEASE_PATH%
32 RMDIR /Q /S %RELEASE_PATH%
33)
34
35:: Create build output directory
36MKDIR %RELEASE_PATH%
37
Joachim Krech347ff5a2016-05-13 08:56:15 +020038
Martin Günther89be6522016-05-13 07:57:31 +020039:: Copy PDSC file
40COPY ..\..\ARM.CMSIS.pdsc %RELEASE_PATH%\ARM.CMSIS.pdsc
41
Joachim Krech347ff5a2016-05-13 08:56:15 +020042:: Copy LICENSE file
Joachim Krech77988a22016-11-07 17:15:07 +010043COPY ..\..\LICENSE.txt %RELEASE_PATH%\LICENSE.txt
Joachim Krech347ff5a2016-05-13 08:56:15 +020044
Martin Günther89be6522016-05-13 07:57:31 +020045:: Copy Device folder
46XCOPY /Q /S /Y ..\..\Device\*.* %RELEASE_PATH%\Device\*.*
47
48:: Copy CMSIS folder
49:: -- Core files
Jonatan Antoniba9cdf32018-06-29 15:22:59 +020050XCOPY /Q /S /Y ..\..\CMSIS\Core\Include\*.* %RELEASE_PATH%\CMSIS\Core\Include\*.*
Martin Günther89be6522016-05-13 07:57:31 +020051XCOPY /Q /S /Y ..\..\CMSIS\Core\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
Christopher Seidl2e8b8142016-10-25 16:29:05 +020052XCOPY /Q /S /Y ..\..\CMSIS\Core\Template\ARMv8-M\*.* %RELEASE_PATH%\CMSIS\Core\Template\ARMv8-M\*.*
brondanib6bdb2c2017-03-02 16:15:52 +010053XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Include\*.* %RELEASE_PATH%\CMSIS\Core_A\Include\*.*
Vladimir Umek4df83f82017-07-03 09:36:49 +020054XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Source\*.* %RELEASE_PATH%\CMSIS\Core_A\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020055
56:: -- DAP files
57XCOPY /Q /S /Y ..\..\CMSIS\DAP\*.* %RELEASE_PATH%\CMSIS\DAP\*.*
58
59:: -- Driver files
60XCOPY /Q /S /Y ..\..\CMSIS\Driver\*.* %RELEASE_PATH%\CMSIS\Driver\*.*
61
62:: -- DSP files
GuentherMartin41d9e352019-03-14 14:18:28 +010063XCOPY /Q /S /Y ..\..\CMSIS\DSP\*.* %RELEASE_PATH%\CMSIS\DSP\*.*
Martin Günther89be6522016-05-13 07:57:31 +020064
Jonatan Antonia67f5552018-01-18 15:22:46 +010065:: -- NN files
66XCOPY /Q /S /Y ..\..\CMSIS\NN\*.* %RELEASE_PATH%\CMSIS\NN\*.*
67
Martin Günther89be6522016-05-13 07:57:31 +020068:: -- Pack files
Joachim Krech347ff5a2016-05-13 08:56:15 +020069XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
Martin Günther89be6522016-05-13 07:57:31 +020070XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
71
72:: -- RTOS files
73XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
74XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
75
76:: -- RTOS2 files
Robert Rostohareefdc5a2016-07-05 07:25:38 +020077XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
Robert Rostohar04fa90a2017-06-09 13:22:27 +020078XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Source\*.* %RELEASE_PATH%\CMSIS\RTOS2\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020079XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
Robert Rostohardab42a22016-07-01 23:23:16 +020080XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
Martin Günther89be6522016-05-13 07:57:31 +020081
82:: -- SVD files
83XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
84
85:: -- Utilities files
Martin Günther96143552016-09-28 13:30:22 +020086XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
87XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
Joachim Krechc97ec682018-03-06 12:17:28 +010088XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PackIndex.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
89
Martin Günther96143552016-09-28 13:30:22 +020090XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
91XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.4.4\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.4.4\*.*
92XCOPY /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 +020093
Joachim Krech347ff5a2016-05-13 08:56:15 +020094:: -- index file
Martin Günther96143552016-09-28 13:30:22 +020095REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
Martin Günther89be6522016-05-13 07:57:31 +020096
97:: Generate Documentation
98:: -- Generate doxygen files
99PUSHD ..\DoxyGen
100
101:: -- Delete previous generated HTML files
102ECHO.
103ECHO Delete previous generated HTML files
104
105PUSHD ..\Documentation
Joachim Krecha92f9912017-03-10 17:08:23 +0100106FOR %%A IN (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 +0200107POPD
108
109:: -- Generate HTML Files
110ECHO.
111ECHO Generate HTML Files
112
113pushd Core
114doxygen core.dxy
115popd
116
Joachim Krecha92f9912017-03-10 17:08:23 +0100117pushd Core_A
118doxygen core_A.dxy
119popd
120
Martin Günther89be6522016-05-13 07:57:31 +0200121pushd DAP
122doxygen dap.dxy
123popd
124
125pushd Driver
126doxygen Driver.dxy
127popd
128
129pushd DSP
130doxygen dsp.dxy
131popd
132
133pushd General
134doxygen general.dxy
135popd
136
Jonatan Antonia67f5552018-01-18 15:22:46 +0100137pushd NN
138doxygen nn.dxy
139popd
140
Martin Günther89be6522016-05-13 07:57:31 +0200141pushd Pack
142doxygen Pack.dxy
143popd
144
145pushd RTOS
146doxygen rtos.dxy
147popd
148
149pushd RTOS2
150doxygen rtos.dxy
151popd
152
153pushd SVD
154doxygen svd.dxy
155popd
156
Joachim Krecha92f9912017-03-10 17:08:23 +0100157pushd Zone
158doxygen zone.dxy
159popd
160
Martin Günther89be6522016-05-13 07:57:31 +0200161:: -- Copy search style sheet
162ECHO.
163ECHO Copy search style sheets
164copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
165copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
166REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
167copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
168REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
169copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
170copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
Jonatan Antonia67f5552018-01-18 15:22:46 +0100171copy /Y Doxygen_Templates\search.css ..\Documentation\NN\html\search\.
Jonatan Antoni661ead82018-02-22 10:12:48 +0100172xcopy /E /I /Q /Y Zone\genmodel ..\Documentation\Zone\genmodel
173
Martin Günther89be6522016-05-13 07:57:31 +0200174ECHO.
175POPD
176
177:: -- Copy generated doxygen files
178XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
179
180:: -- Remove generated doxygen files
181PUSHD ..\Documentation
Jonatan Antonia67f5552018-01-18 15:22:46 +0100182FOR %%A IN (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 +0200183POPD
184
185
186:: Checking
Joachim Krechb3c26d92016-11-10 16:03:05 +0100187Win32\PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353 -x M364
Martin Günther89be6522016-05-13 07:57:31 +0200188
189:: --Check if PackChk.exe has completed successfully
190IF %errorlevel% neq 0 GOTO ErrPackChk
191
Martin Günther89be6522016-05-13 07:57:31 +0200192:: Packing
193PUSHD %RELEASE_PATH%
194
195:: -- Pipe Pack's Name into Variable
Joachim Krech347ff5a2016-05-13 08:56:15 +0200196SET /P PackName=<PackName.txt
197DEL /Q PackName.txt
Martin Günther89be6522016-05-13 07:57:31 +0200198
199:: Pack files
Joachim Krechc6316a62016-11-10 09:46:05 +0100200ECHO Creating pack file ...
2017z.exe a %PackName% -tzip > zip.log
202ECHO Packaging complete
Martin Günther89be6522016-05-13 07:57:31 +0200203POPD
204GOTO End
205
Martin Günther89be6522016-05-13 07:57:31 +0200206:ErrPackChk
207ECHO PackChk.exe has encountered an error!
208EXIT /b
209
210:End
Joachim Krechc6316a62016-11-10 09:46:05 +0100211ECHO Removing temporary files and folders
Martin Günther89be6522016-05-13 07:57:31 +0200212RMDIR /Q /S %RELEASE_PATH%\CMSIS
213RMDIR /Q /S %RELEASE_PATH%\Device
Joachim Krech7e3c7732016-11-07 17:16:31 +0100214DEL %RELEASE_PATH%\LICENSE.txt
Joachim Krechc6316a62016-11-10 09:46:05 +0100215DEL %RELEASE_PATH%\zip.log
Martin Günther89be6522016-05-13 07:57:31 +0200216
Joachim Krechc6316a62016-11-10 09:46:05 +0100217ECHO gen_pack.bat completed successfully