cbuildgen.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <title>cbuildgen: Build Process Manager</title>
  7. <title>CMSIS-Build: cbuildgen: Build Process Manager</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <link href="cmsis.css" rel="stylesheet" type="text/css" />
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <script type="text/javascript" src="printComponentTabs.js"></script>
  13. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  14. <script type="text/javascript" src="resize.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. $(document).ready(initResizable);
  18. $(window).load(resizeHeight);
  19. </script>
  20. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  21. <script type="text/javascript" src="search/search.js"></script>
  22. <script type="text/javascript">
  23. $(document).ready(function() { searchBox.OnSelectItem(0); });
  24. </script>
  25. </head>
  26. <body>
  27. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  28. <div id="titlearea">
  29. <table cellspacing="0" cellpadding="0">
  30. <tbody>
  31. <tr style="height: 46px;">
  32. <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  33. <td style="padding-left: 0.5em;">
  34. <div id="projectname">CMSIS-Build
  35. &#160;<span id="projectnumber">Version 0.9.0 (beta)</span>
  36. </div>
  37. <div id="projectbrief">Tools, software frameworks, and work flows for productivity with CMSIS based projects</div>
  38. </td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. <!-- end header part -->
  44. <div id="CMSISnav" class="tabs1">
  45. <ul class="tablist">
  46. <script type="text/javascript">
  47. <!--
  48. writeComponentTabs.call(this);
  49. //-->
  50. </script>
  51. </ul>
  52. </div>
  53. <!-- Generated by Doxygen 1.8.6 -->
  54. <script type="text/javascript">
  55. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  56. </script>
  57. <div id="navrow1" class="tabs">
  58. <ul class="tablist">
  59. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  60. <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
  61. <li>
  62. <div id="MSearchBox" class="MSearchBoxInactive">
  63. <span class="left">
  64. <img id="MSearchSelect" src="search/mag_sel.png"
  65. onmouseover="return searchBox.OnSearchSelectShow()"
  66. onmouseout="return searchBox.OnSearchSelectHide()"
  67. alt=""/>
  68. <input type="text" id="MSearchField" value="Search" accesskey="S"
  69. onfocus="searchBox.OnSearchFieldFocus(true)"
  70. onblur="searchBox.OnSearchFieldFocus(false)"
  71. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  72. </span><span class="right">
  73. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  74. </span>
  75. </div>
  76. </li>
  77. </ul>
  78. </div>
  79. </div><!-- top -->
  80. <div id="side-nav" class="ui-resizable side-nav-resizable">
  81. <div id="nav-tree">
  82. <div id="nav-tree-contents">
  83. <div id="nav-sync" class="sync"></div>
  84. </div>
  85. </div>
  86. <div id="splitbar" style="-moz-user-select:none;"
  87. class="ui-resizable-handle">
  88. </div>
  89. </div>
  90. <script type="text/javascript">
  91. $(document).ready(function(){initNavTree('cbuildgen.html','');});
  92. </script>
  93. <div id="doc-content">
  94. <!-- window showing the filter options -->
  95. <div id="MSearchSelectWindow"
  96. onmouseover="return searchBox.OnSearchSelectShow()"
  97. onmouseout="return searchBox.OnSearchSelectHide()"
  98. onkeydown="return searchBox.OnSearchSelectKey(event)">
  99. <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Pages</a></div>
  100. <!-- iframe showing the search results (closed by default) -->
  101. <div id="MSearchResultsWindow">
  102. <iframe src="javascript:void(0)" frameborder="0"
  103. name="MSearchResults" id="MSearchResults">
  104. </iframe>
  105. </div>
  106. <div class="header">
  107. <div class="headertitle">
  108. <div class="title">cbuildgen: Build Process Manager </div> </div>
  109. </div><!--header-->
  110. <div class="contents">
  111. <div class="textblock"><p>The <a class="el" href="cbuildgen.html">cbuildgen</a> is the core tool for the build process. It is called from the <b>Bash</b> command line with the following syntax:</p>
  112. <div class="fragment"><div class="line">cbuildgen &lt;command&gt; &lt;ProjectFile&gt;.cprj [options]</div>
  113. </div><!-- fragment --><p><b>Where:</b></p>
  114. <p><code>cbuildgen</code> is the name of tool.</p>
  115. <p>&lt;<code>command&gt;</code> specifies the operation of <code>cbuildgen</code> (see table below). Only one command is permitted per invocation.</p>
  116. <p>&lt;<code>ProjectFile&gt;</code> is the name of the project file. The file extension (.cprj) is mandatory.</p>
  117. <p>[<code>options</code>] are additional parameters that control the operation (see table below). Note: available options are specific for each command.</p>
  118. <p><b>Commands</b> </p>
  119. <table class="cmtable" summary="cbuildgen commands">
  120. <tr>
  121. <th style="min-width:100px">&lt;command&gt; </th><th style="min-width:185px">Description </th><th style="min-width:175px">Details </th></tr>
  122. <tr>
  123. <td>packlist </td><td>List missing packs </td><td>Check the current list of installed packs in the directory <code>$CMSIS_PACK_ROOT</code>. The URLs of missing packs are written to &lt;ProjectFile&gt;.cp_install file. </td></tr>
  124. <tr>
  125. <td>make </td><td>Generate makefile(s) </td><td>Generates &lt;ProjectFile&gt;.mak for <a class="el" href="Make.html">Make</a> required to build the project. When used with option &ndash;merge it generates also &lt;ProjectFile&gt;_cfg.mak for <a class="el" href="Make.html">Make</a> to update configuration files. This command also generates a ASCII log file &lt;ProjectFile&gt;.clog recording location and version of the selected toolchain, packs, components and config files. The option &ndash;output specifies the destination folder of the generated files. The location of the &lt;ProjectFile&gt;.cprj is used if &ndash;output is not specified. </td></tr>
  126. <tr>
  127. <td>extract </td><td>Extract layer from project </td><td>Creates a sub directory named <code></code>./Layer/&lt;layername&gt;/ for each layer described in &lt;ProjectFile&gt;.cprj. These folders contain a layer description file &lt;layername&gt;.clayer and the project and configuration files belonging to the layer. The option &ndash;layer=&lt;layname&gt; selects a specific layer by name. This option can be specified multiple times to select multiple layers. </td></tr>
  128. <tr>
  129. <td>remove </td><td>Remove layer from project </td><td>Updates the &lt;ProjectFile&gt;.cprj removing the layer description as well as all associated files and components for the layers specified at the command line. The command deletes the associated files from the respecctive project directory. The option &ndash;layer=&lt;layname&gt; selects a specific layer by name and is mandatory. This option can be specified multiple times to remove multiple layers. </td></tr>
  130. <tr>
  131. <td>compose </td><td>Create new project </td><td>Create new &lt;ProjectFile&gt;.cprj from layer files ([...]&lt;layername&gt;.clayer) as well as copying associated files. One or more clayer files are required. </td></tr>
  132. <tr>
  133. <td>add </td><td>Add layer to project </td><td>Updates the &lt;ProjectFile&gt;.cprj adding the layer description as well as all associated files and components for the clayer files specified at the command line. The command copies the associated files from the layer directory into the project directory. One or more clayer files are required. </td></tr>
  134. </table>
  135. <p><b>Options</b> </p>
  136. <table class="cmtable" summary="cbuildgen options">
  137. <tr>
  138. <th style="min-width:100px">[option] </th><th style="min-width:175px">Description </th><th style="min-width:175px">Details </th></tr>
  139. <tr>
  140. <td>--merge </td><td>Update configuration files </td><td>When used with the command <code>make</code>, it generates also &lt;ProjectFile&gt;_cfg.mak for <a class="el" href="Make.html">Make</a> to update configuration files using <a class="el" href="ccmerge.html">ccmerge: Config File Updater</a> (used by command: make). </td></tr>
  141. <tr>
  142. <td>--toolchain=&lt;compiler&gt; </td><td>Specify toolchain </td><td>For projects that can be build with multiple toolchains, it defines the toolchain for the build (used by command: make). </td></tr>
  143. <tr>
  144. <td>--output=&lt;directory&gt; </td><td>Specify output directory </td><td>Specifies the directory for the generated files <b>*.mak</b> files and the base directory for intermediate output from build. (used by command: make). </td></tr>
  145. <tr>
  146. <td>--layer=&lt;layername&gt; </td><td>Specify layer name </td><td>Specifies the name of the layer (used by commands: remove and extract). </td></tr>
  147. <tr>
  148. <td>&lt;directory&gt;/&lt;layername&gt;.clayer </td><td>Specify layer file </td><td>Specifies the directory and filename of the project layer (used by commands: add and compose). </td></tr>
  149. </table>
  150. <p>The <a class="el" href="cbuildgen.html">cbuildgen: Build Process Manager</a> uses information from the CMSIS project file *.cprj, software packs, and environment variables.</p>
  151. <ul>
  152. <li>The *.cprj file lists all software packs (optionally with version), configuration files, and user files along with toolchain specific options.</li>
  153. <li>The software packs are used to get source and include files of software components. The location of software packs is defined with the environment variable $CMSIS_PACK_ROOT.</li>
  154. <li>The version of configuration files is specified in project file *.cprj and related software packs are used to update it.</li>
  155. <li>Device information is read from the device family pack (DFP) that defines the device.</li>
  156. <li>Command line options for a toolchain is used from the <b>&lt;name&gt;.&lt;version&gt;.mak</b> file, if not present in the project file directory, the $CMSIS_COMPILER_ROOT is used.</li>
  157. </ul>
  158. <p>The &lt;ProjectFile&gt;.mak file includes two additional makefiles:</p>
  159. <ul>
  160. <li>include ${CMSIS_BUILD_ROOT}/etc/Whitespace.mak for handling of white space characters in filenames.</li>
  161. <li>include ${CMSIS_COMPILER_ROOT}/&lt;name&gt;.&lt;version&gt;.mak that specifies default options for the toolchain.</li>
  162. </ul>
  163. <p>Note: cbuildgen does not update the *.cprj for commands packlist, make and extract. The merge tool updates the outdated configuration files with new merged data, keeping a copy of the original file.</p>
  164. <h1><a class="anchor" id="cbuild_example"></a>
  165. Usage Example</h1>
  166. <pre class="fragment">$ cbuildgen packlist Simulation.cprj
  167. (cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM
  168. M654: URL 'http://www.keil.com/pack/ARM.CMSIS.5.6.0.pack' was added to the list of missing packages.
  169. M654: URL 'http://www.keil.com/pack/Keil.ARM_Compiler.1.6.1.pack' was added to the list of missing packages.
  170. M650: Command completed successfully.
  171. $ cbuildgen make Simulation.cprj
  172. (cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM
  173. M651: Generated makefile for merging config files: 'Simulation_cfg.mak'
  174. M652: Generated makefile for project build:'Simulation.mak'
  175. </pre><h1><a class="anchor" id="cbuildgen_errors"></a>
  176. Error Messages</h1>
  177. <table class="cmtable" summary="cbuildgen invocation messages">
  178. <tr>
  179. <th>Message Number </th><th>Type </th><th>Description </th><th>Action </th></tr>
  180. <tr>
  181. <td>M200 </td><td>ERROR </td><td>Invalid arguments! </td><td>At least one argument is wrong. See usage and correct the argument. </td></tr>
  182. <tr>
  183. <td>M201 </td><td>ERROR </td><td>Too many arguments! </td><td>There is more arguments passed than allowed. See usage and correct the command line. </td></tr>
  184. <tr>
  185. <td>M202 </td><td>ERROR </td><td>No CPRJ input file was specified </td><td>A *.cprj file is not provided as an argument. </td></tr>
  186. <tr>
  187. <td>M203 </td><td>ERROR </td><td>Error reading file(s) ...! </td><td>The listed file could not be read. Check file content. </td></tr>
  188. <tr>
  189. <td>M204 </td><td>ERROR </td><td>File not found: ...! </td><td>The listed file was not found. </td></tr>
  190. <tr>
  191. <td>M205 </td><td>ERROR </td><td>$CMSIS_PACK_ROOT environment variable is not defined! </td><td>The tool requires the environment variable $CMSIS_PACK_ROOT to locate the CMSIS Packs. </td></tr>
  192. <tr>
  193. <td>M206 </td><td>ERROR </td><td>No command was specified! </td><td>The tool requires a command. See usage information for available commands (e.g. config, make) </td></tr>
  194. <tr>
  195. <td>M207 </td><td>ERROR </td><td>Multiple commands were specified! </td><td>More than one command was provided in arguments. A single command is required. </td></tr>
  196. <tr>
  197. <td>M208 </td><td>ERROR </td><td>Error copying file ...! </td><td>The specified file could not be copied and will be missing during build. </td></tr>
  198. <tr>
  199. <td>M500 </td><td>ERROR </td><td>RTE Model reports: <em>MSG</em> </td><td>Error while preparing data. See message for more details. </td></tr>
  200. <tr>
  201. <td>M502 </td><td>ERROR </td><td>RTE Model reports: <em>#error NUM: NAME : MSG</em> </td><td>Additional software components required. </td></tr>
  202. <tr>
  203. <td>M504 </td><td>ERROR </td><td>RTE Model reports: MISSING: – <em>SPACE NAME</em> </td><td>Add the missing component. </td></tr>
  204. <tr>
  205. <td>M600 </td><td>ERROR </td><td>Package index was not found in 'PATH/.Web </td><td>Check the package repository. </td></tr>
  206. <tr>
  207. <td>M601 </td><td>ERROR </td><td>Package 'VENDOR.NAME' was not found in package index! </td><td>Check the package repository. </td></tr>
  208. <tr>
  209. <td>M602 </td><td>ERROR </td><td>Package 'VENDOR.NAME.VER' was not found! </td><td>Check the package repository. </td></tr>
  210. <tr>
  211. <td>M603 </td><td>ERROR </td><td>No version of package 'VENDOR.NAME' was found! </td><td>Check the package repository. </td></tr>
  212. <tr>
  213. <td>M604 </td><td>ERROR </td><td>Unresolved package component: 'CMP' </td><td>Check project description file. </td></tr>
  214. <tr>
  215. <td>M605 </td><td>ERROR </td><td>Wrong CPRJ specification! </td><td>Check project description file. </td></tr>
  216. <tr>
  217. <td>M606 </td><td>ERROR </td><td>Device 'DEV (VENDOR)' was not found! </td><td>Check project description file. </td></tr>
  218. <tr>
  219. <td>M607 </td><td>ERROR </td><td>RTE Model construction failed! </td><td>The CMSIS-Pack engine reports an error message. </td></tr>
  220. <tr>
  221. <td>M608 </td><td>ERROR </td><td>No toolchain configuration file for 'NAME' version 'VER" was found! </td><td>Check CMSIS_COMPILER_ROOT or add the required toolchain configuration file to the project directory. </td></tr>
  222. <tr>
  223. <td>M609 </td><td>ERROR </td><td>Missing 'NAME' element in CPRJ file! </td><td>Check project description file. </td></tr>
  224. <tr>
  225. <td>M610 </td><td>ERROR </td><td>Project supports multiple toolchains. Select one with the option &ndash;toolchain </td><td>See usage and correct the argument. </td></tr>
  226. <tr>
  227. <td>M611 </td><td>ERROR </td><td>Selected toolchain is not supported by the project </td><td>Check project description file or command line arguments. </td></tr>
  228. <tr>
  229. <td>M630 </td><td>WARNING </td><td>Device ... is substituted by device variant ... . </td><td>Instead of the device specified by the project a variant found for this device is used. </td></tr>
  230. <tr>
  231. <td>M650 </td><td>INFO </td><td>Setup run successfully </td><td>For information only./td&gt; </td></tr>
  232. <tr>
  233. <td>M651 </td><td>INFO </td><td>Generated makefile for merging config files: ... </td><td>For information only. </td></tr>
  234. <tr>
  235. <td>M652 </td><td>INFO </td><td>Generated makefile for project build:'NAME%.mak' </td><td>For information only. </td></tr>
  236. <tr>
  237. <td>M653 </td><td>INFO </td><td>Local config file ... was not found. Copying default file from package. </td><td>Please validate whether the config file is intentionally missing. The default config file may be missing project specific settings. </td></tr>
  238. <tr>
  239. <td>M654 </td><td>INFO </td><td>URL ... was added to the list of missing packages. </td><td>For information only. </td></tr>
  240. <tr>
  241. <td>M655 </td><td>INFO </td><td>CMSIS_COMPILER_ROOT environment variable was not set! </td><td>For information only. </td></tr>
  242. <tr>
  243. <td>M656 </td><td>INFO </td><td>Package 'VENDOR.NAME.VER' was found in local repository 'PATH'! </td><td>For information only. </td></tr>
  244. </table>
  245. </div></div><!-- contents -->
  246. </div><!-- doc-content -->
  247. <!-- start footer part -->
  248. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  249. <ul>
  250. <li class="navelem"><a class="el" href="CmdLineBuild.html">Command Line Build</a></li>
  251. <li class="footer">Generated on Thu Apr 9 2020 15:49:55 for CMSIS-Build Version 0.9.0 (beta) by Arm Ltd. All rights reserved.
  252. <!--
  253. <a href="http://www.doxygen.org/index.html">
  254. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
  255. -->
  256. </li>
  257. </ul>
  258. </div>
  259. </body>
  260. </html>