blob: ad51d98d432246ae848f9e4859409cea173716ce [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
50XCOPY /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
62XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
63XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
Martin Günther10babd82016-06-14 14:10:36 +020064XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020065XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Examples\*.*
66
67:: -- DSP libraries
Martin Günther10babd82016-06-14 14:10:36 +020068XCOPY /Q /S /Y ..\..\CMSIS\Lib\ARM\*.lib %RELEASE_PATH%\CMSIS\Lib\ARM\*.*
69XCOPY /Q /S /Y ..\..\CMSIS\Lib\GCC\*.a %RELEASE_PATH%\CMSIS\Lib\GCC\*.*
Martin Günther89be6522016-05-13 07:57:31 +020070
71:: -- Pack files
Joachim Krech347ff5a2016-05-13 08:56:15 +020072XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
Martin Günther89be6522016-05-13 07:57:31 +020073XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
74
75:: -- RTOS files
76XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
77XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
78
79:: -- RTOS2 files
Robert Rostohareefdc5a2016-07-05 07:25:38 +020080XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
Robert Rostohar04fa90a2017-06-09 13:22:27 +020081XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Source\*.* %RELEASE_PATH%\CMSIS\RTOS2\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020082XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
Robert Rostohardab42a22016-07-01 23:23:16 +020083XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
Martin Günther89be6522016-05-13 07:57:31 +020084
85:: -- SVD files
86XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
87
88:: -- Utilities files
Martin Günther96143552016-09-28 13:30:22 +020089XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
90XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
Martin Günther96143552016-09-28 13:30:22 +020091XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
92XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.4.4\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.4.4\*.*
93XCOPY /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 +020094
Joachim Krech347ff5a2016-05-13 08:56:15 +020095:: -- index file
Martin Günther96143552016-09-28 13:30:22 +020096REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
Martin Günther89be6522016-05-13 07:57:31 +020097
98:: Generate Documentation
99:: -- Generate doxygen files
100PUSHD ..\DoxyGen
101
102:: -- Delete previous generated HTML files
103ECHO.
104ECHO Delete previous generated HTML files
105
106PUSHD ..\Documentation
Joachim Krecha92f9912017-03-10 17:08:23 +0100107FOR %%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 +0200108POPD
109
110:: -- Generate HTML Files
111ECHO.
112ECHO Generate HTML Files
113
114pushd Core
115doxygen core.dxy
116popd
117
Joachim Krecha92f9912017-03-10 17:08:23 +0100118pushd Core_A
119doxygen core_A.dxy
120popd
121
Martin Günther89be6522016-05-13 07:57:31 +0200122pushd DAP
123doxygen dap.dxy
124popd
125
126pushd Driver
127doxygen Driver.dxy
128popd
129
130pushd DSP
131doxygen dsp.dxy
132popd
133
134pushd General
135doxygen general.dxy
136popd
137
138pushd Pack
139doxygen Pack.dxy
140popd
141
142pushd RTOS
143doxygen rtos.dxy
144popd
145
146pushd RTOS2
147doxygen rtos.dxy
148popd
149
150pushd SVD
151doxygen svd.dxy
152popd
153
Joachim Krecha92f9912017-03-10 17:08:23 +0100154pushd Zone
155doxygen zone.dxy
156popd
157
Martin Günther89be6522016-05-13 07:57:31 +0200158:: -- Copy search style sheet
159ECHO.
160ECHO Copy search style sheets
161copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
162copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
163REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
164copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
165REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
166copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
167copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
168
169ECHO.
170POPD
171
172:: -- Copy generated doxygen files
173XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
174
175:: -- Remove generated doxygen files
176PUSHD ..\Documentation
Joachim Krecha92f9912017-03-10 17:08:23 +0100177FOR %%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 +0200178POPD
179
180
181:: Checking
Joachim Krechb3c26d92016-11-10 16:03:05 +0100182Win32\PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353 -x M364
Martin Günther89be6522016-05-13 07:57:31 +0200183
184:: --Check if PackChk.exe has completed successfully
185IF %errorlevel% neq 0 GOTO ErrPackChk
186
Martin Günther89be6522016-05-13 07:57:31 +0200187:: Packing
188PUSHD %RELEASE_PATH%
189
190:: -- Pipe Pack's Name into Variable
Joachim Krech347ff5a2016-05-13 08:56:15 +0200191SET /P PackName=<PackName.txt
192DEL /Q PackName.txt
Martin Günther89be6522016-05-13 07:57:31 +0200193
194:: Pack files
Joachim Krechc6316a62016-11-10 09:46:05 +0100195ECHO Creating pack file ...
1967z.exe a %PackName% -tzip > zip.log
197ECHO Packaging complete
Martin Günther89be6522016-05-13 07:57:31 +0200198POPD
199GOTO End
200
Martin Günther89be6522016-05-13 07:57:31 +0200201:ErrPackChk
202ECHO PackChk.exe has encountered an error!
203EXIT /b
204
205:End
Joachim Krechc6316a62016-11-10 09:46:05 +0100206ECHO Removing temporary files and folders
Martin Günther89be6522016-05-13 07:57:31 +0200207RMDIR /Q /S %RELEASE_PATH%\CMSIS
208RMDIR /Q /S %RELEASE_PATH%\Device
Joachim Krech7e3c7732016-11-07 17:16:31 +0100209DEL %RELEASE_PATH%\LICENSE.txt
Joachim Krechc6316a62016-11-10 09:46:05 +0100210DEL %RELEASE_PATH%\zip.log
Martin Günther89be6522016-05-13 07:57:31 +0200211
Joachim Krechc6316a62016-11-10 09:46:05 +0100212ECHO gen_pack.bat completed successfully