blob: b02e5a6231ff2b2a9f454757849946c7b53174a5 [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\*.*
Jonatan Antoni648ac2c2019-03-18 12:07:41 +010051XCOPY /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
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 Antoni9feb2b22019-03-15 14:54:08 +010065XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP\Source\*.*
66XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP\Projects\*.*
67XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP\Examples\*.*
Jonatan Antonif35c2902019-03-15 15:32:28 +010068XCOPY /Q /S /Y ..\..\CMSIS\DSP\Lib\*.* %RELEASE_PATH%\CMSIS\DSP\Lib\*.*
Martin Günther89be6522016-05-13 07:57:31 +020069
Jonatan Antonia67f5552018-01-18 15:22:46 +010070:: -- NN files
71XCOPY /Q /S /Y ..\..\CMSIS\NN\*.* %RELEASE_PATH%\CMSIS\NN\*.*
72
Martin Günther89be6522016-05-13 07:57:31 +020073:: -- Pack files
Joachim Krech347ff5a2016-05-13 08:56:15 +020074XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
Martin Günther89be6522016-05-13 07:57:31 +020075XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
76
77:: -- RTOS files
78XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
79XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
80
81:: -- RTOS2 files
Robert Rostohareefdc5a2016-07-05 07:25:38 +020082XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
Robert Rostohar04fa90a2017-06-09 13:22:27 +020083XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Source\*.* %RELEASE_PATH%\CMSIS\RTOS2\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020084XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
Robert Rostohardab42a22016-07-01 23:23:16 +020085XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
Martin Günther89be6522016-05-13 07:57:31 +020086
87:: -- SVD files
88XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
89
90:: -- Utilities files
Martin Günther96143552016-09-28 13:30:22 +020091XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
92XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
Joachim Krechc97ec682018-03-06 12:17:28 +010093XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PackIndex.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
94
Martin Günther96143552016-09-28 13:30:22 +020095XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
96XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.4.4\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.4.4\*.*
97XCOPY /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 +020098
Joachim Krech347ff5a2016-05-13 08:56:15 +020099:: -- index file
Martin Günther96143552016-09-28 13:30:22 +0200100REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
Martin Günther89be6522016-05-13 07:57:31 +0200101
102:: Generate Documentation
103:: -- Generate doxygen files
104PUSHD ..\DoxyGen
105
106:: -- Delete previous generated HTML files
107ECHO.
108ECHO Delete previous generated HTML files
109
110PUSHD ..\Documentation
Joachim Krecha92f9912017-03-10 17:08:23 +0100111FOR %%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 +0200112POPD
113
114:: -- Generate HTML Files
115ECHO.
116ECHO Generate HTML Files
117
118pushd Core
119doxygen core.dxy
120popd
121
Joachim Krecha92f9912017-03-10 17:08:23 +0100122pushd Core_A
123doxygen core_A.dxy
124popd
125
Martin Günther89be6522016-05-13 07:57:31 +0200126pushd DAP
127doxygen dap.dxy
128popd
129
130pushd Driver
131doxygen Driver.dxy
132popd
133
134pushd DSP
135doxygen dsp.dxy
136popd
137
138pushd General
139doxygen general.dxy
140popd
141
Jonatan Antonia67f5552018-01-18 15:22:46 +0100142pushd NN
143doxygen nn.dxy
144popd
145
Martin Günther89be6522016-05-13 07:57:31 +0200146pushd Pack
147doxygen Pack.dxy
148popd
149
150pushd RTOS
151doxygen rtos.dxy
152popd
153
154pushd RTOS2
155doxygen rtos.dxy
156popd
157
158pushd SVD
159doxygen svd.dxy
160popd
161
Joachim Krecha92f9912017-03-10 17:08:23 +0100162pushd Zone
163doxygen zone.dxy
164popd
165
Martin Günther89be6522016-05-13 07:57:31 +0200166:: -- Copy search style sheet
167ECHO.
168ECHO Copy search style sheets
169copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
170copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
171REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
172copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
173REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
174copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
175copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
Jonatan Antonia67f5552018-01-18 15:22:46 +0100176copy /Y Doxygen_Templates\search.css ..\Documentation\NN\html\search\.
Jonatan Antoni661ead82018-02-22 10:12:48 +0100177xcopy /E /I /Q /Y Zone\genmodel ..\Documentation\Zone\genmodel
178
Martin Günther89be6522016-05-13 07:57:31 +0200179ECHO.
180POPD
181
182:: -- Copy generated doxygen files
183XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
184
185:: -- Remove generated doxygen files
186PUSHD ..\Documentation
Jonatan Antonia67f5552018-01-18 15:22:46 +0100187FOR %%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 +0200188POPD
189
190
191:: Checking
Jonatan Antonie6182fe2019-07-03 14:12:52 +0200192Win32\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 +0200193
194:: --Check if PackChk.exe has completed successfully
195IF %errorlevel% neq 0 GOTO ErrPackChk
196
Martin Günther89be6522016-05-13 07:57:31 +0200197:: Packing
198PUSHD %RELEASE_PATH%
199
200:: -- Pipe Pack's Name into Variable
Joachim Krech347ff5a2016-05-13 08:56:15 +0200201SET /P PackName=<PackName.txt
202DEL /Q PackName.txt
Martin Günther89be6522016-05-13 07:57:31 +0200203
204:: Pack files
Joachim Krechc6316a62016-11-10 09:46:05 +0100205ECHO Creating pack file ...
2067z.exe a %PackName% -tzip > zip.log
207ECHO Packaging complete
Martin Günther89be6522016-05-13 07:57:31 +0200208POPD
209GOTO End
210
Martin Günther89be6522016-05-13 07:57:31 +0200211:ErrPackChk
212ECHO PackChk.exe has encountered an error!
213EXIT /b
214
215:End
Joachim Krechc6316a62016-11-10 09:46:05 +0100216ECHO Removing temporary files and folders
Martin Günther89be6522016-05-13 07:57:31 +0200217RMDIR /Q /S %RELEASE_PATH%\CMSIS
218RMDIR /Q /S %RELEASE_PATH%\Device
Joachim Krech7e3c7732016-11-07 17:16:31 +0100219DEL %RELEASE_PATH%\LICENSE.txt
Joachim Krechc6316a62016-11-10 09:46:05 +0100220DEL %RELEASE_PATH%\zip.log
Martin Günther89be6522016-05-13 07:57:31 +0200221
Joachim Krechc6316a62016-11-10 09:46:05 +0100222ECHO gen_pack.bat completed successfully