1 :: Batch file for generating CMSIS-FreeRTOS pack
2 :: This batch file uses:
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)
10 :: Tool path for zipping tool 7-Zip
11 SET ZIPPATH=C:\Program Files\7-Zip
13 :: Tool path for doxygen
14 SET DOXYGENPATH=C:\Program Files\doxygen\bin
16 :: Tool path for mscgen utility
17 SET MSCGENPATH=C:\Program Files (x86)\Mscgen
19 :: These settings should be passed on to subprocesses as well
20 SET PATH=%ZIPPATH%;%DOXYGENPATH%;%MSCGENPATH%;%PATH%
22 :: Pack Path (where generated pack is stored)
23 SET RELEASE_PATH=..\Local_Release
29 :: Remove previous build
30 IF EXIST %RELEASE_PATH% (
31 ECHO removing %RELEASE_PATH%
32 RMDIR /Q /S %RELEASE_PATH%
35 :: Create build output directory
40 COPY .\..\ARM.CMSIS-FreeRTOS.pdsc %RELEASE_PATH%\ARM.CMSIS-FreeRTOS.pdsc
43 XCOPY /Q /S /Y .\..\License\*.* %RELEASE_PATH%\License\*.*
45 :: Copy various root files
46 COPY .\..\readme.txt %RELEASE_PATH%\readme.txt
47 COPY .\..\links_to_doc_pages_for_the_demo_projects.url %RELEASE_PATH%\links_to_doc_pages_for_the_demo_projects.url
50 XCOPY /Q /S /Y .\..\CMSIS\*.* %RELEASE_PATH%\CMSIS\*.*
53 XCOPY /Q /S /Y .\..\Config\*.* %RELEASE_PATH%\Config\*.*
56 XCOPY /Q /S /Y .\..\Demo\*.* %RELEASE_PATH%\Demo\*.*
59 XCOPY /Q /S /Y .\..\Source\*.* %RELEASE_PATH%\Source\*.*
62 :: Generate Documentation
63 :: -- Generate doxygen files
66 :: -- Delete previous generated HTML files
68 ECHO Delete previous generated HTML files
70 IF EXIST ..\Documentation (
71 ECHO Documenation folder already exists
72 PUSHD ..\Documentation
73 FOR %%A IN (General) DO IF EXIST %%A (RMDIR /S /Q %%A)
76 ECHO create Documentation folder
77 MKDIR ..\Documentation
80 :: -- Generate HTML Files
82 ECHO Generate HTML Files
88 :: -- Copy search style sheet
90 ECHO Copy search style sheets
91 XCOPY /Q /S /Y Doxygen_Templates\search.css ..\Documentation\General\html\search\
96 :: -- Copy generated doxygen files
97 XCOPY /Q /S /Y ..\Documentation\*.* %RELEASE_PATH%\CMSIS\Documentation\*.*
99 :: -- Remove generated doxygen files
100 PUSHD ..\Documentation
101 FOR %%A IN (General) DO IF EXIST %%A (RMDIR /S /Q %%A)
106 :: Silencing warnings that are irrelevant in the context (M324, M382, M363)
107 Win32\PackChk.exe %RELEASE_PATH%\ARM.CMSIS-FreeRTOS.pdsc -n %RELEASE_PATH%\PackName.txt -x M353 -x M364 -x M324 -x M382 -x M363 -x M362
109 :: --Check if PackChk.exe has completed successfully
110 IF %errorlevel% neq 0 GOTO ErrPackChk
115 :: -- Pipe Pack's Name into Variable
116 SET /P PackName=<PackName.txt
120 ECHO Creating pack file ...
121 7z.exe a %PackName% -tzip > zip.log
122 ECHO Packaging complete
127 ECHO PackChk.exe has encountered an error!
131 ECHO Removing temporary files and folders
133 FOR %%A IN (CMSIS Config Demo Source) DO IF EXIST %%A (RMDIR /S /Q %%A)
134 DEL links_to_doc_pages_for_the_demo_projects.url
136 DEL License\license.txt
141 ECHO gen_pack.bat completed successfully