blob: 4a7ee38d3c25cfedb0323df459acc295b7c76794 [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\*.*
61XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Examples\*.*
62
63:: -- DSP libraries
64XCOPY /Q /S /Y ..\..\CMSIS\DSP\Lib\ARM\*.lib %RELEASE_PATH%\CMSIS\Lib\ARM\*.*
65XCOPY /Q /S /Y ..\..\CMSIS\DSP\Lib\GCC\*.a %RELEASE_PATH%\CMSIS\Lib\GCC\*.*
66
67:: -- Pack files
Joachim Krech347ff5a2016-05-13 08:56:15 +020068XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
Martin Günther89be6522016-05-13 07:57:31 +020069XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
70
71:: -- RTOS files
72XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
73XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
74
75:: -- RTOS2 files
76XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
77
78:: -- SVD files
79XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
80
81:: -- Utilities files
82XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
83XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
84XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PackChk.exe %RELEASE_PATH%\CMSIS\Utilities\*.*
85XCOPY /Q /S /Y ..\..\CMSIS\Utilities\SVDConv.exe %RELEASE_PATH%\CMSIS\Utilities\*.*
86XCOPY /Q /S /Y ..\..\CMSIS\Utilities\SVDConv.linux %RELEASE_PATH%\CMSIS\Utilities\*.*
87
Joachim Krech347ff5a2016-05-13 08:56:15 +020088:: -- index file
89COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
Martin Günther89be6522016-05-13 07:57:31 +020090
91:: Generate Documentation
92:: -- Generate doxygen files
93PUSHD ..\DoxyGen
94
95:: -- Delete previous generated HTML files
96ECHO.
97ECHO Delete previous generated HTML files
98
99PUSHD ..\Documentation
100FOR %%A IN (Core, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD) DO IF EXIST %%A (RMDIR /S /Q %%A)
101POPD
102
103:: -- Generate HTML Files
104ECHO.
105ECHO Generate HTML Files
106
107pushd Core
108doxygen core.dxy
109popd
110
111pushd DAP
112doxygen dap.dxy
113popd
114
115pushd Driver
116doxygen Driver.dxy
117popd
118
119pushd DSP
120doxygen dsp.dxy
121popd
122
123pushd General
124doxygen general.dxy
125popd
126
127pushd Pack
128doxygen Pack.dxy
129popd
130
131pushd RTOS
132doxygen rtos.dxy
133popd
134
135pushd RTOS2
136doxygen rtos.dxy
137popd
138
139pushd SVD
140doxygen svd.dxy
141popd
142
143:: -- Copy search style sheet
144ECHO.
145ECHO Copy search style sheets
146copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
147copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
148REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
149copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
150REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
151copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
152copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
153
154ECHO.
155POPD
156
157:: -- Copy generated doxygen files
158XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
159
160:: -- Remove generated doxygen files
161PUSHD ..\Documentation
162FOR %%A IN (Core, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD) DO IF EXIST %%A (RMDIR /S /Q %%A)
163POPD
164
165
166:: Checking
167PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353
168
169:: --Check if PackChk.exe has completed successfully
170IF %errorlevel% neq 0 GOTO ErrPackChk
171
Martin Günther89be6522016-05-13 07:57:31 +0200172:: Packing
173PUSHD %RELEASE_PATH%
174
175:: -- Pipe Pack's Name into Variable
Joachim Krech347ff5a2016-05-13 08:56:15 +0200176SET /P PackName=<PackName.txt
177DEL /Q PackName.txt
Martin Günther89be6522016-05-13 07:57:31 +0200178
179:: Pack files
1807z.exe a %PackName% -tzip
Martin Günther89be6522016-05-13 07:57:31 +0200181POPD
182GOTO End
183
Martin Günther89be6522016-05-13 07:57:31 +0200184:ErrPackChk
185ECHO PackChk.exe has encountered an error!
186EXIT /b
187
188:End
189ECHO removing temporary folders
190RMDIR /Q /S %RELEASE_PATH%\CMSIS
191RMDIR /Q /S %RELEASE_PATH%\Device
Joachim Krech347ff5a2016-05-13 08:56:15 +0200192DEL %RELEASE_PATH%\LICENSE
Martin Günther89be6522016-05-13 07:57:31 +0200193
194ECHO PACK generation completed.