📄 x-680x02.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Motorola MC680x0 </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-680x0.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-680x01.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-680x03.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="84383">A.2 Building Applications</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84384"> </a>The Tornado 2.0 project facility is correctly preconfigured for building WRS BSPs. However, if you choose not to use the project facility or if you need to customize your build, you may need the information in the following sections. This includes a configuration constant, an environment variable, and compiler options that together specify the information the GNU toolkit requires to compile correctly for MC680<i class="textVariable">x</i>0 targets. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84387">Defining the CPU Type</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84388"> </a>Setting the preprocessor variable <b class="symbol_UC">CPU</b> ensures that VxWorks and your applications build with the appropriate architecture-specific features enabled. Define this variable to one of the following values, to match the processor you are using:</p></dl><dl class="margin"><ul class="DashSingle" type="circle"><li><a name="84389"> </a><b class="symbol_UC">MC68000</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="84390"> </a><b class="symbol_UC">MC68010</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="84391"> </a><b class="symbol_UC">MC68020</b> (used also for MC68030 processors) </li></ul><ul class="DashSingle" type="circle"><li><a name="84392"> </a><b class="symbol_UC">MC68040</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="84393"> </a><b class="symbol_UC">MC68LC040</b> (used also for MC68EC040 processors) </li></ul><ul class="DashSingle" type="circle"><li><a name="84394"> </a><b class="symbol_UC">MC68060</b> </li></ul><ul class="DashSingle" type="circle"><li><a name="84395"> </a><b class="symbol_UC">CPU32</b> </li></ul></dl><dl class="margin"><dd><p class="Body"><a name="84396"> </a>For example, to define <b class="symbol_UC">CPU</b> for a MC68040 on the compiler command line, specify the following command-line option when you invoke the compiler:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84397">-DCPU=MC68040</a></b></pre></dl><dd><p class="Body"><a name="84398"> </a>To provide the same information in a header or source file instead, include the following line in the file:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84399">#define CPU MC68040</a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84401">Configuring the GNU ToolKit Environment</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84402"> </a>Tornado includes the GNU compiler and associated tools. Tornado is configured to use these tools by default. No change is required to the execution path, because the compilation chain is installed in the same <b class="file">bin</b> directory as the other Tornado executables. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84404">Compiling C or C++ Modules</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84405"> </a>The following is an example of a compiler command line for MC680<i class="textVariable">x</i>0 cross-development. The file to be compiled in this example has a base name of <b class="file">applic</b>.</p><dl class="margin"><dd><pre class="Code2"><b><a name="84406"></b><tt class="output">% </tt><b>cc68k -DCPU=MC68040 -I $WIND_BASE/target/h -fno-builtin \ -O -nostdinc -c applic.<i class="textVariable">language_id</i></a></b></pre></dl><dd><p class="Body"><a name="84410"> </a>The options shown in the example have the following meanings:<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup></p></dl><dl class="margin"><dd><div class="Item"><a name="84412"> </a><b class="symbol_UC">-DCPU=MC68040</b> </div><dl class="margin"><dd><div class="Indent"><a name="84413"> </a>Required; defines the CPU type. If you are using another MC680<i class="textVariable">x</i>0 processor, specify the appropriate value (see <a href="x-680x02.html#84387"><i class="title">Defining the CPU Type</i></a>).</div><br></dl><dd><div class="Item"><a name="84418"> </a><b class="command">-I</b> <b class="symbol_UC">$WIND_BASE</b><b class="file">/target/h</b> </div><dl class="margin"><dd><div class="Indent"><a name="84419"> </a>Required; includes VxWorks header files. (Additional <b class="command">-I</b> flags may be included to specify other header files.)</div><br></dl><dd><div class="Item"><a name="84421"> </a><b class="command">-fno-builtin</b> </div><dl class="margin"><dd><div class="Indent"><a name="84422"> </a>Required; uses library calls even for common library subroutines.</div><br></dl><dd><div class="Item"><a name="84424"> </a><b class="command">-O</b> </div><dl class="margin"><dd><div class="Indent"><a name="84425"> </a>Optional; performs standard optimization.</div><br></dl><dd><div class="Item"><a name="84427"> </a><b class="command">-nostdinc</b> </div><dl class="margin"><dd><div class="Indent"><a name="84428"> </a>Required; searches only the directory specified with the <b class="command">-I</b> flag (see above) and the current directory for header files. Does not search host-system include files.</div><br></dl><dd><div class="Item"><a name="84430"> </a><b class="command">-c</b> </div><dl class="margin"><dd><div class="Indent"><a name="84431"> </a>Required; specifies that the module is to be compiled only, and not linked for execution under the host.</div><br></dl><dd><div class="Item"><a name="84433"> </a><b class="file">applic.</b><i class="textVariable">language_id </i></div><dl class="margin"><dd><div class="Indent"><a name="84434"> </a>Required; the file(s) to compile. For C compilation, specify a suffix of <b class="file">.c</b>. For C++ compilation, specify a suffix of <b class="file">.cpp</b>. The output is an unlinked object module in <b class="file">a.out</b> format with the suffix <b class="file">.o</b>; for the example, the output is <b class="file">applic.o</b>.</div><br><dd><div class="Indent"><a name="84435"> </a>During C++ compilation, the compiled object module (<i class="textVariable">applic</i><b class="file">.o</b>) is <i class="term">munched</i>. Munching is the process of scanning an object module for non-local static objects, and generating data structures that VxWorks run-time support can use to call the objects' constructors and destructors. See the <i class="title">VxWorks Programmer's Guide: C++ Development </i>for details.</div><br></dl><dd><div class="Item"><a name="85373"> </a><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="85378"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION: </font></b></a>Do not use <b class="command">-msoft-float</b> on the MC68040 or MC68060. However, do use this flag for floating-point support on the MC68LC040. See <a href="x-680x04.html#84781"><i class="title">Floating-Point Support</i></a>.<b> </b></div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></div></dl></dl><a name="foot"><hr></a><p class="FootnoteNumberMarker">1: <span class="Footnote"><a name="84409"> </a>For more information on these and other compiler options, see the <i class="title">GNU ToolKit User's Guide</i>. WRS supports compiler options used in building WRS software; a list of these options is included in the <i class="title">Guide</i>. Other options are not supported, although they are available with the tools as shipped.</span><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-680x0.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-680x01.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-680x03.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -