blob: 9a00ec66190ac18e0272146e77300e09fdf251f8 [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\*.*
Martin Günther89be6522016-05-13 07:57:31 +020052
53:: -- DAP files
54XCOPY /Q /S /Y ..\..\CMSIS\DAP\*.* %RELEASE_PATH%\CMSIS\DAP\*.*
55
56:: -- Driver files
57XCOPY /Q /S /Y ..\..\CMSIS\Driver\*.* %RELEASE_PATH%\CMSIS\Driver\*.*
58
59:: -- DSP files
60XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
61XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
Martin Günther10babd82016-06-14 14:10:36 +020062XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
Martin Günther89be6522016-05-13 07:57:31 +020063XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Examples\*.*
64
65:: -- DSP libraries
Martin Günther10babd82016-06-14 14:10:36 +020066XCOPY /Q /S /Y ..\..\CMSIS\Lib\ARM\*.lib %RELEASE_PATH%\CMSIS\Lib\ARM\*.*
67XCOPY /Q /S /Y ..\..\CMSIS\Lib\GCC\*.a %RELEASE_PATH%\CMSIS\Lib\GCC\*.*
Martin Günther89be6522016-05-13 07:57:31 +020068
69:: -- Pack files
Joachim Krech347ff5a2016-05-13 08:56:15 +020070XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
Martin Günther89be6522016-05-13 07:57:31 +020071XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
72
73:: -- RTOS files
74XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
75XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
76
77:: -- RTOS2 files
Robert Rostohareefdc5a2016-07-05 07:25:38 +020078XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
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\*.*
88XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PackChk.exe %RELEASE_PATH%\CMSIS\Utilities\*.*
89XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
90XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.4.4\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.4.4\*.*
91XCOPY /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 +020092
Joachim Krech347ff5a2016-05-13 08:56:15 +020093:: -- index file
Martin Günther96143552016-09-28 13:30:22 +020094REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
Martin Günther89be6522016-05-13 07:57:31 +020095
96:: Generate Documentation
97:: -- Generate doxygen files
98PUSHD ..\DoxyGen
99
100:: -- Delete previous generated HTML files
101ECHO.
102ECHO Delete previous generated HTML files
103
104PUSHD ..\Documentation
105FOR %%A IN (Core, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD) DO IF EXIST %%A (RMDIR /S /Q %%A)
106POPD
107
108:: -- Generate HTML Files
109ECHO.
110ECHO Generate HTML Files
111
112pushd Core
113doxygen core.dxy
114popd
115
116pushd DAP
117doxygen dap.dxy
118popd
119
120pushd Driver
121doxygen Driver.dxy
122popd
123
124pushd DSP
125doxygen dsp.dxy
126popd
127
128pushd General
129doxygen general.dxy
130popd
131
132pushd Pack
133doxygen Pack.dxy
134popd
135
136pushd RTOS
137doxygen rtos.dxy
138popd
139
140pushd RTOS2
141doxygen rtos.dxy
142popd
143
144pushd SVD
145doxygen svd.dxy
146popd
147
148:: -- Copy search style sheet
149ECHO.
150ECHO Copy search style sheets
151copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
152copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
153REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
154copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
155REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
156copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
157copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
158
159ECHO.
160POPD
161
162:: -- Copy generated doxygen files
163XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
164
165:: -- Remove generated doxygen files
166PUSHD ..\Documentation
167FOR %%A IN (Core, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD) DO IF EXIST %%A (RMDIR /S /Q %%A)
168POPD
169
170
171:: Checking
172PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353
173
174:: --Check if PackChk.exe has completed successfully
175IF %errorlevel% neq 0 GOTO ErrPackChk
176
Martin Günther89be6522016-05-13 07:57:31 +0200177:: Packing
178PUSHD %RELEASE_PATH%
179
180:: -- Pipe Pack's Name into Variable
Joachim Krech347ff5a2016-05-13 08:56:15 +0200181SET /P PackName=<PackName.txt
182DEL /Q PackName.txt
Martin Günther89be6522016-05-13 07:57:31 +0200183
184:: Pack files
1857z.exe a %PackName% -tzip
Martin Günther89be6522016-05-13 07:57:31 +0200186POPD
187GOTO End
188
Martin Günther89be6522016-05-13 07:57:31 +0200189:ErrPackChk
190ECHO PackChk.exe has encountered an error!
191EXIT /b
192
193:End
194ECHO removing temporary folders
195RMDIR /Q /S %RELEASE_PATH%\CMSIS
196RMDIR /Q /S %RELEASE_PATH%\Device
Joachim Krech7e3c7732016-11-07 17:16:31 +0100197DEL %RELEASE_PATH%\LICENSE.txt
Martin Günther89be6522016-05-13 07:57:31 +0200198
Joachim Krech7e3c7732016-11-07 17:16:31 +0100199ECHO PACK generation completed.