blob: 8a064ad3c59394b33b60ccb67e757cf0d8c06c84 [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
43COPY ..\..\LICENSE %RELEASE_PATH%\LICENSE
44
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\*.*
51
52:: -- DAP files
53XCOPY /Q /S /Y ..\..\CMSIS\DAP\*.* %RELEASE_PATH%\CMSIS\DAP\*.*
54
55:: -- Driver files
56XCOPY /Q /S /Y ..\..\CMSIS\Driver\*.* %RELEASE_PATH%\CMSIS\Driver\*.*
57
58:: -- DSP files
59XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
60XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
Martin Günther10babd82016-06-14 14:10:36 +020061XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020062XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Examples\*.*
63
64:: -- DSP libraries
Martin Günther10babd82016-06-14 14:10:36 +020065XCOPY /Q /S /Y ..\..\CMSIS\Lib\ARM\*.lib %RELEASE_PATH%\CMSIS\Lib\ARM\*.*
66XCOPY /Q /S /Y ..\..\CMSIS\Lib\GCC\*.a %RELEASE_PATH%\CMSIS\Lib\GCC\*.*
Martin Günther89be6522016-05-13 07:57:31 +020067
68:: -- 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
77XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
Robert Rostohardab42a22016-07-01 23:23:16 +020078XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
Martin Günther89be6522016-05-13 07:57:31 +020079
80:: -- SVD files
81XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
82
83:: -- Utilities files
84XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
85XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
86XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PackChk.exe %RELEASE_PATH%\CMSIS\Utilities\*.*
87XCOPY /Q /S /Y ..\..\CMSIS\Utilities\SVDConv.exe %RELEASE_PATH%\CMSIS\Utilities\*.*
88XCOPY /Q /S /Y ..\..\CMSIS\Utilities\SVDConv.linux %RELEASE_PATH%\CMSIS\Utilities\*.*
89
Joachim Krech347ff5a2016-05-13 08:56:15 +020090:: -- index file
91COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
Martin Günther89be6522016-05-13 07:57:31 +020092
93:: Generate Documentation
94:: -- Generate doxygen files
95PUSHD ..\DoxyGen
96
97:: -- Delete previous generated HTML files
98ECHO.
99ECHO Delete previous generated HTML files
100
101PUSHD ..\Documentation
102FOR %%A IN (Core, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD) DO IF EXIST %%A (RMDIR /S /Q %%A)
103POPD
104
105:: -- Generate HTML Files
106ECHO.
107ECHO Generate HTML Files
108
109pushd Core
110doxygen core.dxy
111popd
112
113pushd DAP
114doxygen dap.dxy
115popd
116
117pushd Driver
118doxygen Driver.dxy
119popd
120
121pushd DSP
122doxygen dsp.dxy
123popd
124
125pushd General
126doxygen general.dxy
127popd
128
129pushd Pack
130doxygen Pack.dxy
131popd
132
133pushd RTOS
134doxygen rtos.dxy
135popd
136
137pushd RTOS2
138doxygen rtos.dxy
139popd
140
141pushd SVD
142doxygen svd.dxy
143popd
144
145:: -- Copy search style sheet
146ECHO.
147ECHO Copy search style sheets
148copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
149copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
150REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
151copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
152REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
153copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
154copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
155
156ECHO.
157POPD
158
159:: -- Copy generated doxygen files
160XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
161
162:: -- Remove generated doxygen files
163PUSHD ..\Documentation
164FOR %%A IN (Core, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD) DO IF EXIST %%A (RMDIR /S /Q %%A)
165POPD
166
167
168:: Checking
169PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353
170
171:: --Check if PackChk.exe has completed successfully
172IF %errorlevel% neq 0 GOTO ErrPackChk
173
Martin Günther89be6522016-05-13 07:57:31 +0200174:: Packing
175PUSHD %RELEASE_PATH%
176
177:: -- Pipe Pack's Name into Variable
Joachim Krech347ff5a2016-05-13 08:56:15 +0200178SET /P PackName=<PackName.txt
179DEL /Q PackName.txt
Martin Günther89be6522016-05-13 07:57:31 +0200180
181:: Pack files
1827z.exe a %PackName% -tzip
Martin Günther89be6522016-05-13 07:57:31 +0200183POPD
184GOTO End
185
Martin Günther89be6522016-05-13 07:57:31 +0200186:ErrPackChk
187ECHO PackChk.exe has encountered an error!
188EXIT /b
189
190:End
191ECHO removing temporary folders
192RMDIR /Q /S %RELEASE_PATH%\CMSIS
193RMDIR /Q /S %RELEASE_PATH%\Device
Joachim Krech347ff5a2016-05-13 08:56:15 +0200194DEL %RELEASE_PATH%\LICENSE
Martin Günther89be6522016-05-13 07:57:31 +0200195
196ECHO PACK generation completed.