| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- :: Batch file for generating CMSIS pack
- :: This batch file uses:
- :: 7-Zip for packaging
- :: Doxygen version 1.8.2 and Mscgen version 0.20 for generating html documentation.
- :: The generated pack and pdsc file are placed in folder %RELEASE_PATH% (../../Local_Release)
- @ECHO off
- SETLOCAL
- :: Tool path for zipping tool 7-Zip
- SET ZIPPATH=C:\Program Files\7-Zip
- :: Tool path for doxygen
- SET DOXYGENPATH=C:\Program Files\doxygen\bin
- :: Tool path for mscgen utility
- SET MSCGENPATH=C:\Program Files (x86)\Mscgen
- :: These settings should be passed on to subprocesses as well
- SET PATH=%ZIPPATH%;%DOXYGENPATH%;%MSCGENPATH%;%PATH%
- :: Pack Path (where generated pack is stored)
- SET RELEASE_PATH=..\..\Local_Release
- :: !!!!!!!!!!!!!!!!!
- :: DO NOT EDIT BELOW
- :: !!!!!!!!!!!!!!!!!
- :: Remove previous build
- IF EXIST %RELEASE_PATH% (
- ECHO removing %RELEASE_PATH%
- RMDIR /Q /S %RELEASE_PATH%
- )
- :: Create build output directory
- MKDIR %RELEASE_PATH%
- :: Copy PDSC file
- COPY ..\..\ARM.CMSIS.pdsc %RELEASE_PATH%\ARM.CMSIS.pdsc
- :: Copy LICENSE file
- COPY ..\..\LICENSE.txt %RELEASE_PATH%\LICENSE.txt
- :: Copy Device folder
- XCOPY /Q /S /Y ..\..\Device\*.* %RELEASE_PATH%\Device\*.*
- :: Copy CMSIS folder
- :: -- Core files
- XCOPY /Q /S /Y ..\..\CMSIS\Core\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Core\Template\ARMv8-M\*.* %RELEASE_PATH%\CMSIS\Core\Template\ARMv8-M\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Include\*.* %RELEASE_PATH%\CMSIS\Core_A\Include\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Core_A\Source\*.* %RELEASE_PATH%\CMSIS\Core_A\Source\*.*
- :: -- DAP files
- XCOPY /Q /S /Y ..\..\CMSIS\DAP\*.* %RELEASE_PATH%\CMSIS\DAP\*.*
- :: -- Driver files
- XCOPY /Q /S /Y ..\..\CMSIS\Driver\*.* %RELEASE_PATH%\CMSIS\Driver\*.*
- :: -- DSP files
- XCOPY /Q /S /Y ..\..\CMSIS\DSP\Include\*.* %RELEASE_PATH%\CMSIS\Include\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\DSP\Source\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\DSP\Projects\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Source\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\DSP\Examples\*.* %RELEASE_PATH%\CMSIS\DSP_Lib\Examples\*.*
- :: -- DSP libraries
- XCOPY /Q /S /Y ..\..\CMSIS\Lib\ARM\*.lib %RELEASE_PATH%\CMSIS\Lib\ARM\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Lib\GCC\*.a %RELEASE_PATH%\CMSIS\Lib\GCC\*.*
- :: -- NN files
- XCOPY /Q /S /Y ..\..\CMSIS\NN\*.* %RELEASE_PATH%\CMSIS\NN\*.*
- :: -- Pack files
- XCOPY /Q /S /Y ..\..\CMSIS\Pack\Example\*.* %RELEASE_PATH%\CMSIS\Pack\Example\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Pack\Tutorials\*.* %RELEASE_PATH%\CMSIS\Pack\Tutorials\*.*
- :: -- RTOS files
- XCOPY /Q /S /Y ..\..\CMSIS\RTOS\Template\*.* %RELEASE_PATH%\CMSIS\RTOS\Template\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\RTOS\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS\RTX\*.*
- :: -- RTOS2 files
- XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Include\*.* %RELEASE_PATH%\CMSIS\RTOS2\Include\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Source\*.* %RELEASE_PATH%\CMSIS\RTOS2\Source\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\Template\*.* %RELEASE_PATH%\CMSIS\RTOS2\Template\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\RTOS2\RTX\*.* %RELEASE_PATH%\CMSIS\RTOS2\RTX\*.*
- :: -- SVD files
- XCOPY /Q /S /Y ..\..\CMSIS\Utilities\ARM_Example.* %RELEASE_PATH%\CMSIS\SVD\*.*
- :: -- Utilities files
- XCOPY /Q /S /Y ..\..\CMSIS\Utilities\CMSIS-SVD.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Utilities\PACK.xsd %RELEASE_PATH%\CMSIS\Utilities\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Win32\*.* %RELEASE_PATH%\CMSIS\Utilities\Win32\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.4.4\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.4.4\*.*
- XCOPY /Q /S /Y ..\..\CMSIS\Utilities\Linux-gcc-4.8.3\*.* %RELEASE_PATH%\CMSIS\Utilities\Linux-gcc-4.8.3\*.*
- :: -- index file
- REM COPY ..\..\CMSIS\index.html %RELEASE_PATH%\CMSIS\index.html
- :: Generate Documentation
- :: -- Generate doxygen files
- PUSHD ..\DoxyGen
- :: -- Delete previous generated HTML files
- ECHO.
- ECHO Delete previous generated HTML files
- PUSHD ..\Documentation
- FOR %%A IN (Core, Core_A, DAP, Driver, DSP, General, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
- POPD
- :: -- Generate HTML Files
- ECHO.
- ECHO Generate HTML Files
- pushd Core
- doxygen core.dxy
- popd
- pushd Core_A
- doxygen core_A.dxy
- popd
- pushd DAP
- doxygen dap.dxy
- popd
- pushd Driver
- doxygen Driver.dxy
- popd
- pushd DSP
- doxygen dsp.dxy
- popd
- pushd General
- doxygen general.dxy
- popd
- pushd NN
- doxygen nn.dxy
- popd
- pushd Pack
- doxygen Pack.dxy
- popd
- pushd RTOS
- doxygen rtos.dxy
- popd
- pushd RTOS2
- doxygen rtos.dxy
- popd
- pushd SVD
- doxygen svd.dxy
- popd
- pushd Zone
- doxygen zone.dxy
- popd
- :: -- Copy search style sheet
- ECHO.
- ECHO Copy search style sheets
- copy /Y Doxygen_Templates\search.css ..\Documentation\CORE\html\search\.
- copy /Y Doxygen_Templates\search.css ..\Documentation\Driver\html\search\.
- REM copy /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\.
- copy /Y Doxygen_Templates\search.css ..\Documentation\Pack\html\search\.
- REM copy /Y Doxygen_Templates\search.css ..\Documentation\SVD\html\search\.
- copy /Y Doxygen_Templates\search.css ..\Documentation\DSP\html\search\.
- copy /Y Doxygen_Templates\search.css ..\Documentation\DAP\html\search\.
- copy /Y Doxygen_Templates\search.css ..\Documentation\NN\html\search\.
-
- ECHO.
- POPD
- :: -- Copy generated doxygen files
- XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
- :: -- Remove generated doxygen files
- PUSHD ..\Documentation
- FOR %%A IN (Core, Core_A, DAP, Driver, DSP, General, NN, Pack, RTOS, RTOS2, SVD, Zone) DO IF EXIST %%A (RMDIR /S /Q %%A)
- POPD
- :: Checking
- Win32\PackChk.exe %RELEASE_PATH%\ARM.CMSIS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353 -x M364
- :: --Check if PackChk.exe has completed successfully
- IF %errorlevel% neq 0 GOTO ErrPackChk
- :: Packing
- PUSHD %RELEASE_PATH%
- :: -- Pipe Pack's Name into Variable
- SET /P PackName=<PackName.txt
- DEL /Q PackName.txt
- :: Pack files
- ECHO Creating pack file ...
- 7z.exe a %PackName% -tzip > zip.log
- ECHO Packaging complete
- POPD
- GOTO End
- :ErrPackChk
- ECHO PackChk.exe has encountered an error!
- EXIT /b
- :End
- ECHO Removing temporary files and folders
- RMDIR /Q /S %RELEASE_PATH%\CMSIS
- RMDIR /Q /S %RELEASE_PATH%\Device
- DEL %RELEASE_PATH%\LICENSE.txt
- DEL %RELEASE_PATH%\zip.log
- ECHO gen_pack.bat completed successfully
|