📄 ref.make.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>make</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="The eCos Component Writer's Guide"HREF="cdl-guide.html"><LINKREL="UP"TITLE="CDL Language Specification"HREF="reference.html"><LINKREL="PREVIOUS"TITLE="library"HREF="ref.library.html"><LINKREL="NEXT"TITLE="make_object"HREF="ref.make-object.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The <SPANCLASS="APPLICATION">eCos</SPAN> Component Writer's Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="ref.library.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="ref.make-object.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="REF.MAKE"><SPANCLASS="PROPERTY">make</SPAN></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN4710"></A><H2>Name</H2>Property <SPANCLASS="PROPERTY">make</SPAN> -- Define an additional custom build step associated with anoption, resulting in a target that should not go directly into a library.</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN4714"><H2>Synopsis</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SYNOPSIS">cdl_option <name> { make [-priority=<pri>] { <custom build step> } …}</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN4716"></A><H2>Description</H2><P>When building an <SPANCLASS="APPLICATION">eCos</SPAN> configuration the primary target is a singlelibrary, <TTCLASS="FILENAME">libtarget.a</TT>. In some cases it isnecessary to build some additional targets. For example architecturalHAL packages typically build a linker script and some start-up code.Such additional targets can be specified by a <SPANCLASS="PROPERTY">make</SPAN> property. Anyoption can have one or more <SPANCLASS="PROPERTY">make</SPAN> properties, although typically suchproperties only occur in the body of a <TTCLASS="LITERAL">cdl_package</TT> command.</P><P>The <SPANCLASS="PROPERTY">make</SPAN> property takes a single argument, which resembles amakefile rule: it consists of a target, a list of dependencies, andone or more commands that should be executed. However the argument isnot a makefile fragment, and custom build steps may get executed inbuild environments that do not involve make. For full details ofcustom build steps see <AHREF="build.make.html#BUILD.CUSTOM">the Section called <I>Custom Build Steps</I> in Chapter 4</A>.</P><DIVCLASS="WARNING"><P></P><TABLECLASS="WARNING"BORDER="1"WIDTH="100%"><TR><TDALIGN="CENTER"><B>Warning</B></TD></TR><TR><TDALIGN="LEFT"><P>The exact syntax and limitations of custom build steps have not yetbeen finalized, and are subject to change in future versions of theconfiguration tools.</P></TD></TR></TABLE></DIV><P>The <SPANCLASS="PROPERTY">make</SPAN> property takes an optional priority argument indicating theorder in which build steps take place. This priority complements thedependency list, and avoids problems with packages needing to knowdetails of custom build steps in other packages (which may changebetween releases). The defined order is:</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Priority 0</DT><DD><P>The header files exported by the current set of packages are copiedto the appropriate places in the<TTCLASS="FILENAME">include</TT> subdirectory of theinstall tree. Any unnecessary copies are avoided, to prevent rebuildsof package and application source modules caused by header file dependencies.</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>A possible future enhancement of the build system may result in thebuild and install trees being updated automatically if there has beena change to the <TTCLASS="FILENAME">ecos.ecc</TT> configuration savefile.</P></BLOCKQUOTE></DIV></DD><DT>Priority 100</DT><DD><P>All files specified in <SPANCLASS="PROPERTY">compile</SPAN> properties will get built, producingthe corresponding object files. In addition any custom build stepsdefined by <SPANCLASS="PROPERTY">make_object</SPAN> properties get executed, unless there isa <TTCLASS="LITERAL">-priority=</TT> option.</P></DD><DT>Priority 200</DT><DD><P>The libraries now get built using the appropriate object files.</P></DD><DT>Priority 300</DT><DD><P>Any custom build steps specified by <SPANCLASS="PROPERTY">make</SPAN> properties now getexecuted, unless the priority for a particular build step is changedfrom its default.</P></DD></DL></DIV><P>For example, if a custom build step needs to take place before any ofthe normal source files get compiled then it should be given apriority somewhere between 0 and 100. If a custom build step involvespost-processing an object file prior to its incorporation into alibrary then a priority between 100 and 200 should be used.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN4757"></A><H2>Example</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">cdl_package CYGPKG_HAL_MN10300_AM33 { display "MN10300 AM33 variant" parent CYGPKG_HAL_MN10300 implements CYGINT_HAL_MN10300_VARIANT hardware include_dir cyg/hal define_header hal_mn10300_am33.h description " The MN10300 AM33 variant HAL package provides generic support for this processor architecture. It is also necessary to select a specific target platform HAL package." make { <PREFIX>/lib/target.ld: <PACKAGE>/src/mn10300_am33.ld $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $< @echo $@ ": \\" > $(notdir $@).deps @tail +2 target.tmp >> $(notdir $@).deps @echo >> $(notdir $@).deps @rm target.tmp }}</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN4760"></A><H2>See Also</H2><P>Properties <AHREF="ref.compile.html">compile</A>,<AHREF="ref.make-object.html">make_object</A> and<AHREF="ref.library.html">library</A>.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="ref.library.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="cdl-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="ref.make-object.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><SPANCLASS="PROPERTY">library</SPAN></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="reference.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><SPANCLASS="PROPERTY">make_object</SPAN></TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -