⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-config8.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    Configuration and Build   </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="c-config.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-config7.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-config9.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="86474">8.8  &nbsp;&nbsp;Makefiles for BSPs and Applications</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86477"> </a>Makefiles for VxWorks applications are easy to create by exploiting the makefiles and <b class="command">make</b> include files shipped with VxWorks BSPs. This section discusses how the VxWorks BSP makefiles are structured. An example of how to utilize this structure for application makefiles is in <a href="c-config8.html#86626"><i class="title">8.8.2&nbsp;Using Makefile Include Files for Application Modules</i></a>.</p><dd><p class="Body"><a name="86482"> </a>In Tornado, a set of supporting files in <i class="textVariable">installDir</i><b class="file">/target/h/make</b> makes it possible for each BSP or application <b class="file">Makefile</b> to be terse, specifying only the essential parameters that are unique to the object being built.</p><dd><p class="Body"><a name="86486"> </a><a href="c-config8.html#89703">Example&nbsp;8-1</a> shows the makefile from the <i class="textVariable">installDir</i><b class="file">/target/config/mv147</b> directory; the makefile for any other BSP is similar. Two variables are defined at the start of the makefile: <b class="symbol_UC">CPU</b>, to specify the target architecture, and <b class="symbol_UC">TOOL</b> to identify what compilation tools to use. Based on the values of these variables and on the environment variables defined as part of your Tornado configuration, the makefile selects the appropriate set of definitions from <i class="textVariable">installDir</i><b class="file">/target/h/make</b>. After the standard definitions, several variables define properties specific to this BSP. Finally, the standard rules for building a BSP on your host are included. </p></dl></dl><h4 class="EntityTitle"><a name="89703"><font face="Helvetica, sans-serif" size="-1" class="sans">Example 8-1:&nbsp;&nbsp;Makefile for MVME147</font></a></h4><dl class="margin"><dl class="margin"><dd><pre class="Code"><b><a name="89704"># Makefile - makefile for target/config/mv147 # # Copyright 1984-1995 Wind River Systems, Inc. # # DESCRIPTION # This file contains rules for building VxWorks for the # Motorola MVME147. #*/  CPU              = MC68020 TOOL             = gnu  include $(WIND_BASE)/target/h/make/defs.bsp include $(WIND_BASE)/target/h/make/make.$(CPU)$(TOOL) include $(WIND_BASE)/target/h/make/defs.$(WIND_HOST_TYPE)  ## Only redefine make definitions below this point, or your definitions  ## will be overwritten by the makefile stubs above.   TARGET_DIR       = mv147 VENDOR           = Motorola BOARD            = MVME147, MVME147S-1  # # The constants ROM_TEXT_ADRS, ROM_SIZE, and RAM_HIGH_ADRS are  # defined in config.h as well as in this Makefile. # Both definitions of these constants must be identical. #  ROM_TEXT_ADRS    = ff800008 # ROM entry address ROM_SIZE         = 00020000 # number of bytes of ROM space  RAM_LOW_ADRS     = 00001000 # RAM text/data address RAM_HIGH_ADRS    = 00090000 # RAM text/data address  HEX_FLAGS        = -v -p $(ROM_TEXT_ADRS) -a 8  MACH_EXTRA       =    ## Only redefine make definitions above this point, or the expansion of  ## makefile target dependencies may be incorrect.  include $(WIND_BASE)/target/h/make/rules.bsp include $(WIND_BASE)/target/h/make/rules.$(WIND_HOST_TYPE)</a></b></pre></dl><dl class="margin"><dd><p class="Body"><a name="86493"> </a>There are two kinds of include files in <i class="textVariable">installDir</i><b class="file">/target/h/make</b> (as reflected by the two blocks of <b class="keyword">include</b> statements in <a href="c-config8.html#89703">Example&nbsp;8-1</a>): variable definitions, and rule definitions. Just as for <b class="keyword">#include</b> statements in the C preprocessor, <b class="keyword">include</b> statements in makefiles accept the slash (<b class="operator">/</b>) character between directory segments of a file name. This feature of GNU <b class="command">make</b> helps to write portable makefiles.</p><dd><p class="Body"><a name="86498"> </a>The following <b class="command">make</b> include files define variables. These files are useful for application-module makefiles, as well as for BSP makefiles.</p></dl><dl class="margin"><dd><div class="Item"><a name="86499"> </a><b class="file">defs.bsp </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86500"> </a>Standard variable definitions for a VxWorks run-time system.</div><br></dl></dl><dd><div class="Item"><a name="86501"> </a><b class="file">make.$(</b><b class="symbol_UC">CPU</b><b class="file">)$(</b><b class="symbol_UC">TOOL</b><b class="file">) </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86502"> </a>Files named using this pattern (such as <b class="file">make.MC68060gnu</b>) provide definitions for a particular target architecture and a particular set of compilation tools, such as architecture-specific tool names and option flags.</div><br></dl></dl><dd><div class="Item"><a name="86503"> </a><b class="file">defs.$(</b><b class="symbol_UC">WIND_HOST_TYPE</b><b class="file">) </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86504"> </a>Files named using this pattern (such as <b class="file">make.x86-win32</b>) provide definitions that depend on the host system: names of tools that are independent of the target architecture, and pathnames for the Tornado installation on your host.</div><br></dl></dl></dl><dl class="margin"><dd><p class="Body"><a name="86505"> </a>The following include files define <b class="command">make</b> targets, and the rules to build them. These files are usually not required for building application modules in separate directories, because most of the rules they define are specific to the VxWorks run-time system and boot programs.</p></dl><dl class="margin"><dd><div class="Item"><a name="86506"> </a><b class="file">rules.bsp </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86507"> </a>Rules defining all the standard targets for building a VxWorks run-time system (described in <a href="c-config7.html#86335"><i class="title">8.7&nbsp;Building a VxWorks System Image</i></a> and <a href="c-config9.html#86670"><i class="title">8.9&nbsp;Creating Bootable Applications</i></a>). The rules for building object code from C, C++, or assembly language are also spelled out here.</div><br></dl></dl><dd><div class="Item"><a name="86514"> </a><b class="file">rules.$(</b><b class="symbol_UC">WIND_HOST_TYPE</b><b class="file">) </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86515"> </a>Files named using this pattern (such as <b class="file">make.x86-win32</b>) specify targets that depend only on the host system (dependency lists).</div><br></dl></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="86517">8.8.1  &nbsp;&nbsp;Make Variables</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86519"> </a>The variables defined in the <b class="command">make</b> include files provide convenient defaults for most situations, and allow individual makefiles to specify only the definitions that are unique to each. This section describes the <b class="command">make</b> variables most often used to specify properties of BSPs or applications. The following lists are not intended to be comprehensive; see the <b class="command">make</b> include files for the complete set.</p></dl></dl><dl class="margin"><dd><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/note.gif"></td><td><hr><div class="CalloutCell"><a name="86524"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE:  </font></b></a>Certain <b class="command">make</b> variables are intended specifically for customization; see <a href="c-config8.html#86594"><i class="title">Variables for Customizing the Run-Time</i></a>. Do not override other variables in BSP makefiles. They are described in the following sections for expository purposes. </div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="86532">Variables for Compilation Options</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86534"> </a>The variables grouped in this section are useful for either BSP makefiles or application-module makefiles. They specify aspects of how to invoke the compiler.</p></dl><dl class="margin"><dd><div class="Item"><a name="86536"> </a><b class="symbol_UC">CFLAGS </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86537"> </a>The complete set of option flags for any invocation of the C compiler. This variable gathers the options specified in <b class="symbol_UC">CC_COMPILER</b>, <b class="symbol_UC">CC_WARNINGS</b>, <b class="symbol_UC">CC_OPTIM</b>, <b class="symbol_UC">CC_INCLUDE</b>, <b class="symbol_UC">CC_DEFINES</b>, and <b class="symbol_UC">ADDED_CFLAGS</b>. To add your own option flags, define them as <b class="symbol_UC">ADDED_CFLAGS</b>.</div><br></dl></dl><dd><div class="Item"><a name="86539"> </a><b class="symbol_UC">C++FLAGS </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86540"> </a>The complete set of option flags for any invocation of the C++ compiler. This variable gathers together the options specified in <b class="symbol_UC">C++_COMPILER</b>, <b class="symbol_UC">C++_WARNINGS</b>, <b class="symbol_UC">CC_OPTIM</b>, <b class="symbol_UC">CC_INCLUDE</b>, <b class="symbol_UC">CC_DEFINES</b>, and <b class="symbol_UC">ADDED_C++FLAGS</b>. To add your own option flags, use <b class="symbol_UC">ADDED_C++FLAGS</b>.</div><br></dl></dl><dd><div class="Item"><a name="86542"> </a><b class="symbol_UC">CC_COMPILER </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86543"> </a>Option flags specific to compiling the C language. Default: <b class="command">-ansi</b> <b class="command">-nostdinc</b>.</div><br></dl></dl><dd><div class="Item"><a name="86545"> </a><b class="symbol_UC">C++_COMPILER </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86546"> </a>Option flags specific to compiling the C++ language. Default: <b class="command">-ansi</b> <b class="command">-nostdinc</b>.</div><br></dl></dl><dd><div class="Item"><a name="86548"> </a><b class="symbol_UC">CC_WARNINGS </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86549"> </a>Option flags to select the level of warning messages from the compiler, when compiling C programs. Two predefined sets of warnings are available: <b class="symbol_UC">CC_WARNINGS_ALL</b> (the compiler's most comprehensive collection of warnings) and <b class="symbol_UC">CC_WARNINGS_NONE</b> (no warning flags). Default: <b class="symbol_UC">CC_WARNINGS_ALL</b>.</div><br></dl></dl><dd><div class="Item"><a name="86551"> </a><b class="symbol_UC">C++_WARNINGS </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86552"> </a>Option flags to select the level of warning messages from the compiler, when compiling C++ programs. The same two sets of flags are available as for C programs. Default: <b class="symbol_UC">CC_WARNINGS_NONE</b>.</div><br></dl></dl><dd><div class="Item"><a name="86554"> </a><b class="symbol_UC">CC_OPTIM</b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86555"> </a>Optimization flags. Three sets of flags are predefined for each architecture: <b class="symbol_UC">CC_OPTIM_DRIVER</b> (optimization level appropriate to a device driver), <b class="symbol_UC">CC_OPTIM_TARGET</b> (optimization level for BSPs), and <b class="symbol_UC">CC_OPTIM_NORMAL</b> (optimization level for application modules). Default: <b class="symbol_UC">CC_OPTIM_TARGET</b>.</div><br></dl></dl><dd><div class="Item"><a name="86557"> </a><b class="symbol_UC">CC_INCLUDE </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86558"> </a>Standard set of header-file directories. To add application-specific header-file paths, specify them in <b class="symbol_UC">EXTRA_INCLUDE</b>.</div><br></dl></dl><dd><div class="Item"><a name="86560"> </a><b class="symbol_UC">CC_DEFINES </b></div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="86561"> </a>Definitions of preprocessor constants. This variable is predefined to propagate the makefile variable <b class="symbol_UC">CPU</b> to the preprocessor, to include any constants required for particular target architectures, and to include the value of the makefile variable <b class="symbol_UC">EXTRA_DEFINE</b>. To add application-specific constants, specify them in <b class="symbol_UC">EXTRA_DEFINE</b>.</div><br></dl></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="86563">Variables for BSP Parameters</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86565"> </a>The variables included in this section specify properties of a particular BSP, and are thus recorded in each BSP makefile. They are not normally used in application-module makefiles.</p></dl>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -