cbuild_install.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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>Setup Build Environment</title>
  7. <title>CMSIS-Build: Setup Build Environment</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('cbuild_install.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">Setup Build Environment </div> </div>
  109. </div><!--header-->
  110. <div class="contents">
  111. <div class="textblock"><p>The command line build environment for projects that are based on the CMSIS-Pack standard requires:</p>
  112. <ul>
  113. <li>Required: <a href="https://en.wikipedia.org/wiki/Bash_(Unix_shell)" target="_blank"><b>Bash</b></a> for script execution.</li>
  114. <li>Optional: <a class="el" href="cbuild_install.html#libxml">xmllint</a> for XML schema verification.</li>
  115. </ul>
  116. <p>With most Linux distributions these tools are already available. The installation for Windows is explained below.</p>
  117. <p><b>Required for Windows: Bash</b></p>
  118. <ul>
  119. <li><a href="https://gitforwindows.org/" target="_blank"><b>git for Windows</b></a> includes <b>Git Bash</b> which is easy to download and install.</li>
  120. </ul>
  121. <h1><a class="anchor" id="cbuild_install2"></a>
  122. cbuild_install.sh: Install Build Tools</h1>
  123. <p>CMSIS-Build tools are available for download as an asset of the respective <a href="https://github.com/ARM-software/CMSIS_5/releases/" target="_blank"><b>CMSIS Release Version</b></a> (starting 5.7.0 e/o April 2020).</p>
  124. <p>To install the command line build environment start from the Bash prompt: </p>
  125. <div class="fragment"><div class="line">$ ./cbuild_install.sh</div>
  126. </div><!-- fragment --><p>This install script queries for:</p>
  127. <ul>
  128. <li>Directory for the installation of the CMSIS command line build tools (default ./cbuild).</li>
  129. <li>When Keil MDK is installed, enter the base directory of the MDK installation (default /c/Keil_v5).</li>
  130. <li>Directory to store the content of the software packs in CMSIS-Pack format.</li>
  131. </ul>
  132. <h1><a class="anchor" id="cbuild_envsetup"></a>
  133. Environment Variables</h1>
  134. <p>The file <b>./cbuild/etc/setup</b> configures the CMSIS command line build environment. It contains the following section that should reflect the actual installation.</p>
  135. <p><b>File: ./cbuild/etc/setup</b> </p>
  136. <div class="fragment"><div class="line"><span class="preprocessor">############### EDIT BELOW ###############</span></div>
  137. <div class="line"><span class="preprocessor"></span></div>
  138. <div class="line">export CMSIS_PACK_ROOT=/C/Users/myname/AppData/Local/Arm/Packs</div>
  139. <div class="line">export CMSIS_COMPILER_ROOT=/C/myname/cbuild</div>
  140. <div class="line">export MDK_ROOT=/C/Keil_v5</div>
  141. </div><!-- fragment --><p>The file <b>./cbuild/etc/setup</b> is used to setup environment variables in Bash using the <b>source</b> command: </p>
  142. <div class="fragment"><div class="line">$ source ./cbuild/etc/setup</div>
  143. </div><!-- fragment --><table class="doxtable">
  144. <tr>
  145. <th align="left">Variable </th><th align="left">Description </th></tr>
  146. <tr>
  147. <td align="left"><code>$CMSIS_PACK_ROOT</code> </td><td align="left">Directory that contains the software packs in CMSIS-Pack format. </td></tr>
  148. <tr>
  149. <td align="left"><code>$CMSIS_COMPILER_ROOT</code> </td><td align="left">Directory that contains the <a class="el" href="cbuild_install.html#cbuild_compiler_config">Compiler Configuration</a>. </td></tr>
  150. <tr>
  151. <td align="left"><code>$CMSIS_BUILD_ROOT</code> </td><td align="left">Base directory of the CMSIS command line build tools. </td></tr>
  152. <tr>
  153. <td align="left"><code>$MDK_ROOT</code> </td><td align="left">Base directory of the MDK installation (optional). </td></tr>
  154. </table>
  155. <h1><a class="anchor" id="cbuild_compiler_config"></a>
  156. Compiler Configuration</h1>
  157. <p>The CMSIS <a class="el" href="cbuildgen.html">cbuildgen: Build Process Manager</a> uses toolchain specific <b>.mak files</b> that map the CMSIS project settings to the toolchain. For each supported toolchain a <b>.mak files</b> is provided in the directory <b>./cbuild/etc</b> and specifies the base directory of the toolchain installation (TOOLCHAIN_ROOT). In addition other toolchain specific environment variables may be setup here (e.g. license file and product variant). The user is required to update the these settings after installation to reflect the actual installation.</p>
  158. <p><b>Example file: ./cbuild/etc/ARMCC.6.13.1.mak</b></p>
  159. <div class="fragment"><div class="line"><span class="preprocessor"># Version: 1.0.0</span></div>
  160. <div class="line"><span class="preprocessor"></span><span class="preprocessor"># Date: 2020-02-11</span></div>
  161. <div class="line"><span class="preprocessor"></span><span class="preprocessor"># This file maps the CMSIS project options to toolchain settings.</span></div>
  162. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#</span></div>
  163. <div class="line"><span class="preprocessor"></span><span class="preprocessor"># - Applies to toolchain: ARMCC 6.13.1 </span></div>
  164. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#</span></div>
  165. <div class="line"><span class="preprocessor"></span><span class="preprocessor">############### EDIT BELOW ###############</span></div>
  166. <div class="line"><span class="preprocessor"></span><span class="preprocessor"># Set base directory of toolchain</span></div>
  167. <div class="line"><span class="preprocessor"></span>TOOLCHAIN_ROOT:=/C/Keil_v5/ARM/ARMCLANG</div>
  168. <div class="line"> </div>
  169. <div class="line"><span class="preprocessor"># Licensing</span></div>
  170. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#export ARMLMD_LICENSE_FILE=todo</span></div>
  171. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#export ARM_PRODUCT_DEF=$(TOOLCHAIN_ROOT)/../../mappings/gold.elmap</span></div>
  172. <div class="line"><span class="preprocessor"></span> </div>
  173. <div class="line"><span class="preprocessor">############ DO NOT EDIT BELOW ###########</span></div>
  174. </div><!-- fragment --><p>The toolchain for compilation is defined in project file <b>*.cprj</b> and used by <a class="el" href="cbuildgen.html">cbuildgen: Build Process Manager</a>. The <a class="el" href="cbuildgen.html">cbuildgen: Build Process Manager</a> first searches for the toolchain specific <b>.mak file</b> in the project directory. If the toolchain specific <b>.mak file</b> is not present there, it uses the directory that is specified by the <b>$CMSIS_BUILD_ROOT</b> environment variable.</p>
  175. <h1><a class="anchor" id="libxml"></a>
  176. libxml (optional for Windows)</h1>
  177. <p>For Windows the <a href="https://www.zlatkovic.com/pub/libxml/" target="_blank"><b>libxml</b></a> provides an XML processor that provides the functionality of <b>xmllint</b>.</p>
  178. <dl class="section note"><dt>Note</dt><dd>The installation is optional and not required to run the command line build tools.</dd></dl>
  179. <p>Download the following ZIP files:</p>
  180. <ul>
  181. <li><b>iconv-1.9.2.win32.zip</b></li>
  182. <li><b>libxml2-2.7.8.win32.zip</b></li>
  183. <li><b>libxmlsec-1.2.18.win32.zip</b></li>
  184. <li><b>zlib-1.2.5.win32.zip</b></li>
  185. </ul>
  186. <p>Extract the <b>/bin</b> directory of each ZIP file to a directory, for example <b>C:\xmllint</b> and add this directory to the Windows <a href="https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/adding-path-variable/97300613-20cb-4d85-8d0e-cc9d3549ba23" target="_blank"><b>PATH</b></a> environment variable.</p>
  187. <dl class="section note"><dt>Note</dt><dd>Restart the <b>Git Bash</b> after changing the <b>PATH</b> environment variable. </dd>
  188. <dd>
  189. When <b>xmllint</b> is not installed, the XML schema verification is skipped by the <a class="el" href="cbuild.html">cbuild.sh</a> script.</dd></dl>
  190. <p>xmllint is also provided by the xsltproc package that can be installed via <a href="https://chocolatey.org/packages/xsltproc" target="_blank"><b>Chocolatey</b></a>: </p>
  191. <div class="fragment"><div class="line">&gt; choco install xsltproc</div>
  192. </div><!-- fragment --> </div></div><!-- contents -->
  193. </div><!-- doc-content -->
  194. <!-- start footer part -->
  195. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  196. <ul>
  197. <li class="navelem"><a class="el" href="CmdLineBuild.html">Command Line Build</a></li>
  198. <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.
  199. <!--
  200. <a href="http://www.doxygen.org/index.html">
  201. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
  202. -->
  203. </li>
  204. </ul>
  205. </div>
  206. </body>
  207. </html>