OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [cdl-guide/] [ref.compile.html] - Diff between revs 28 and 174

Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- This material may be distributed only subject to the terms      -->
<!-- This material may be distributed only subject to the terms      -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- or later (the latest version is presently available at          -->
<!-- or later (the latest version is presently available at          -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- permission is obtained from the copyright holder.               -->
<!-- permission is obtained from the copyright holder.               -->
<HTML
<HTML
><HEAD
><HEAD
><TITLE
><TITLE
>compile</TITLE
>compile</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
<META
NAME="GENERATOR"
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
"><LINK
REL="HOME"
REL="HOME"
TITLE="The eCos Component Writer's Guide"
TITLE="The eCos Component Writer's Guide"
HREF="cdl-guide.html"><LINK
HREF="cdl-guide.html"><LINK
REL="UP"
REL="UP"
TITLE="CDL Language Specification"
TITLE="CDL Language Specification"
HREF="reference.html"><LINK
HREF="reference.html"><LINK
REL="PREVIOUS"
REL="PREVIOUS"
TITLE="calculated"
TITLE="calculated"
HREF="ref.calculated.html"><LINK
HREF="ref.calculated.html"><LINK
REL="NEXT"
REL="NEXT"
TITLE="default_value"
TITLE="default_value"
HREF="ref.default-value.html"></HEAD
HREF="ref.default-value.html"></HEAD
><BODY
><BODY
CLASS="REFENTRY"
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
BGCOLOR="#FFFFFF"
TEXT="#000000"
TEXT="#000000"
LINK="#0000FF"
LINK="#0000FF"
VLINK="#840084"
VLINK="#840084"
ALINK="#0000FF"
ALINK="#0000FF"
><DIV
><DIV
CLASS="NAVHEADER"
CLASS="NAVHEADER"
><TABLE
><TABLE
SUMMARY="Header navigation table"
SUMMARY="Header navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TH
><TH
COLSPAN="3"
COLSPAN="3"
ALIGN="center"
ALIGN="center"
>The <SPAN
>The <SPAN
CLASS="APPLICATION"
CLASS="APPLICATION"
>eCos</SPAN
>eCos</SPAN
> Component Writer's Guide</TH
> Component Writer's Guide</TH
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="left"
ALIGN="left"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="ref.calculated.html"
HREF="ref.calculated.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="80%"
WIDTH="80%"
ALIGN="center"
ALIGN="center"
VALIGN="bottom"
VALIGN="bottom"
></TD
></TD
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="right"
ALIGN="right"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="ref.default-value.html"
HREF="ref.default-value.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"></DIV
WIDTH="100%"></DIV
><H1
><H1
><A
><A
NAME="REF.COMPILE"><SPAN
NAME="REF.COMPILE"><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
></H1
></H1
><DIV
><DIV
CLASS="REFNAMEDIV"
CLASS="REFNAMEDIV"
><A
><A
NAME="AEN3815"
NAME="AEN3815"
></A
></A
><H2
><H2
>Name</H2
>Name</H2
>Property <SPAN
>Property <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
>&nbsp;--&nbsp;List the source files that should be built if this option
>&nbsp;--&nbsp;List the source files that should be built if this option
is active and enabled.</DIV
is active and enabled.</DIV
><DIV
><DIV
CLASS="REFSYNOPSISDIV"
CLASS="REFSYNOPSISDIV"
><A
><A
NAME="AEN3819"><H2
NAME="AEN3819"><H2
>Synopsis</H2
>Synopsis</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="SYNOPSIS"
CLASS="SYNOPSIS"
>cdl_option &lt;name&gt; {
>cdl_option &lt;name&gt; {
    compile [-library=libxxx.a] &lt;list of files&gt;
    compile [-library=libxxx.a] &lt;list of files&gt;
    &#8230;
    &#8230;
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN3821"
NAME="AEN3821"
></A
></A
><H2
><H2
>Description</H2
>Description</H2
><P
><P
>The <SPAN
>The <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
> property allows component developers to specify source
> property allows component developers to specify source
files which should be compiled and added to one of the target
files which should be compiled and added to one of the target
libraries. Usually each source file will end up the library
libraries. Usually each source file will end up the library
<TT
<TT
CLASS="FILENAME"
CLASS="FILENAME"
>libtarget.a</TT
>libtarget.a</TT
>. It is possible for component writers
>. It is possible for component writers
to specify an alternative library for an entire package using the
to specify an alternative library for an entire package using the
<A
<A
HREF="ref.library.html"
HREF="ref.library.html"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>library</SPAN
>library</SPAN
></A
></A
> property. Alternatively
> property. Alternatively
the desired library can be specified on the <SPAN
the desired library can be specified on the <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
> line itself. For
> line itself. For
example, to add a particular source file to the
example, to add a particular source file to the
<TT
<TT
CLASS="FILENAME"
CLASS="FILENAME"
>libextras.a</TT
>libextras.a</TT
> library the following could be used:</P
> library the following could be used:</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>cdl_package CYGPKG_IO_SERIAL {
>cdl_package CYGPKG_IO_SERIAL {
    &#8230;
    &#8230;
    compile -library=libextras.a common/tty.c
    compile -library=libextras.a common/tty.c
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>Details of the build process including such issues as compiler flags
>Details of the build process including such issues as compiler flags
and the order in which things happen can be found in
and the order in which things happen can be found in
<A
<A
HREF="build.html"
HREF="build.html"
>Chapter 4</A
>Chapter 4</A
>. </P
>. </P
><P
><P
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
> properties can occur in any of <TT
> properties can occur in any of <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_option</TT
>cdl_option</TT
>,
>,
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_component</TT
>cdl_component</TT
>, <TT
>, <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_package</TT
>cdl_package</TT
> or <TT
> or <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_interface</TT
>cdl_interface</TT
>. A <SPAN
>. A <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
>
>
property has effect if and only if the entity that contains it is
property has effect if and only if the entity that contains it is
active and enabled. Typically the body of a <TT
active and enabled. Typically the body of a <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_package</TT
>cdl_package</TT
> will define
> will define
any source files that need to be built irrespective of individual
any source files that need to be built irrespective of individual
options, and each <TT
options, and each <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_component</TT
>cdl_component</TT
>, <TT
>, <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_option</TT
>cdl_option</TT
>, and <TT
>, and <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_interface</TT
>cdl_interface</TT
>
>
will define source files that are more specific. A single <SPAN
will define source files that are more specific. A single <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
>
>
property can list any number of source files, all destined for the
property can list any number of source files, all destined for the
same library. A <TT
same library. A <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_option</TT
>cdl_option</TT
> or other entity can contain multiple
> or other entity can contain multiple
<SPAN
<SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
> properties, each of which can specify a different library.
> properties, each of which can specify a different library.
It is possible for a given source file to be specified in <SPAN
It is possible for a given source file to be specified in <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
>
>
properties for several different options, in which case the source
properties for several different options, in which case the source
file will get built if any of these options are active and enabled.</P
file will get built if any of these options are active and enabled.</P
><P
><P
>If the package follows the <A
>If the package follows the <A
HREF="package.html#PACKAGE.HIERARCHY"
HREF="package.html#PACKAGE.HIERARCHY"
>directory
>directory
layout conventions</A
layout conventions</A
> then the configuration tools will search for
> then the configuration tools will search for
the specified source files first in the
the specified source files first in the
<TT
<TT
CLASS="FILENAME"
CLASS="FILENAME"
>src</TT
>src</TT
> subdirectory of the
> subdirectory of the
package, then relative to the package directory itself. </P
package, then relative to the package directory itself. </P
><DIV
><DIV
CLASS="NOTE"
CLASS="NOTE"
><BLOCKQUOTE
><BLOCKQUOTE
CLASS="NOTE"
CLASS="NOTE"
><P
><P
><B
><B
>Note: </B
>Note: </B
>A shortcoming of the current specification of <SPAN
>A shortcoming of the current specification of <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
> properties is
> properties is
that there is no easy way to specify source files that should be built
that there is no easy way to specify source files that should be built
unless an option is enabled. It would sometimes be useful to be able
unless an option is enabled. It would sometimes be useful to be able
to say: &#8220;if option <TT
to say: &#8220;if option <TT
CLASS="LITERAL"
CLASS="LITERAL"
>A</TT
>A</TT
> is enabled then compile
> is enabled then compile
file <TT
file <TT
CLASS="FILENAME"
CLASS="FILENAME"
>x.c</TT
>x.c</TT
>, otherwise compile file
>, otherwise compile file
<TT
<TT
CLASS="FILENAME"
CLASS="FILENAME"
>y.c</TT
>y.c</TT
>. There are two simple ways of achieving this: </P
>. There are two simple ways of achieving this: </P
><P
><P
></P
></P
><UL
><UL
><LI
><LI
><P
><P
>Always compile <TT
>Always compile <TT
CLASS="FILENAME"
CLASS="FILENAME"
>y.c</TT
>y.c</TT
>, typically by listing it in
>, typically by listing it in
the body of the <TT
the body of the <TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_package</TT
>cdl_package</TT
>, but use
>, but use
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>#ifndef&nbsp;A</TT
>#ifndef&nbsp;A</TT
> to produce an empty object file if
> to produce an empty object file if
option <TT
option <TT
CLASS="LITERAL"
CLASS="LITERAL"
>A</TT
>A</TT
> is not enabled. This has the big
> is not enabled. This has the big
disadvantage that the file always gets compiled and hence for some
disadvantage that the file always gets compiled and hence for some
configurations builds will take longer than necessary.</P
configurations builds will take longer than necessary.</P
></LI
></LI
><LI
><LI
><P
><P
>Use a <SPAN
>Use a <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>calculated</SPAN
>calculated</SPAN
> option whose value is <TT
> option whose value is <TT
CLASS="LITERAL"
CLASS="LITERAL"
>!A</TT
>!A</TT
>, and
>, and
have a <TT
have a <TT
CLASS="LITERAL"
CLASS="LITERAL"
>compile&nbsp;y.c</TT
>compile&nbsp;y.c</TT
> property in its body. This
> property in its body. This
has the big disadvantage of adding another calculated option to the
has the big disadvantage of adding another calculated option to the
configuration.</P
configuration.</P
></LI
></LI
></UL
></UL
><P
><P
>It is likely that this will be resolved in the future, possibly by
>It is likely that this will be resolved in the future, possibly by
using some sort of expression as the argument to a <SPAN
using some sort of expression as the argument to a <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
> property.</P
> property.</P
></BLOCKQUOTE
></BLOCKQUOTE
></DIV
></DIV
><DIV
><DIV
CLASS="NOTE"
CLASS="NOTE"
><BLOCKQUOTE
><BLOCKQUOTE
CLASS="NOTE"
CLASS="NOTE"
><P
><P
><B
><B
>Note: </B
>Note: </B
>Currently it is not possible to control the priority of a <SPAN
>Currently it is not possible to control the priority of a <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
>
>
property, in other words the order in which a file gets compiled
property, in other words the order in which a file gets compiled
relative to other build steps. This functionality might prove useful
relative to other build steps. This functionality might prove useful
for complicated packages and should be added.</P
for complicated packages and should be added.</P
></BLOCKQUOTE
></BLOCKQUOTE
></DIV
></DIV
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN3874"
NAME="AEN3874"
></A
></A
><H2
><H2
>Example</H2
>Example</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>cdl_package CYGPKG_INFRA {
>cdl_package CYGPKG_INFRA {
    display       "Infrastructure"
    display       "Infrastructure"
    include_dir   cyg/infra
    include_dir   cyg/infra
    description   "
    description   "
        Common types and useful macros.
        Common types and useful macros.
        Tracing and assertion facilities.
        Tracing and assertion facilities.
        Package startup options."
        Package startup options."
 
 
    compile startup.cxx prestart.cxx pkgstart.cxx userstart.cxx \
    compile startup.cxx prestart.cxx pkgstart.cxx userstart.cxx \
            dummyxxmain.cxx memcpy.c memset.c delete.cxx \
            dummyxxmain.cxx memcpy.c memset.c delete.cxx \
            diag.cxx tcdiag.cxx
            diag.cxx tcdiag.cxx
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN3877"
NAME="AEN3877"
></A
></A
><H2
><H2
>See Also</H2
>See Also</H2
><P
><P
>Properties <A
>Properties <A
HREF="ref.make.html"
HREF="ref.make.html"
>make</A
>make</A
>,
>,
<A
<A
HREF="ref.make-object.html"
HREF="ref.make-object.html"
>make_object</A
>make_object</A
> and
> and
<A
<A
HREF="ref.library.html"
HREF="ref.library.html"
>library</A
>library</A
>.</P
>.</P
></DIV
></DIV
><DIV
><DIV
CLASS="NAVFOOTER"
CLASS="NAVFOOTER"
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
SUMMARY="Footer navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ref.calculated.html"
HREF="ref.calculated.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="cdl-guide.html"
HREF="cdl-guide.html"
ACCESSKEY="H"
ACCESSKEY="H"
>Home</A
>Home</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ref.default-value.html"
HREF="ref.default-value.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>calculated</SPAN
>calculated</SPAN
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="reference.html"
HREF="reference.html"
ACCESSKEY="U"
ACCESSKEY="U"
>Up</A
>Up</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>default_value</SPAN
>default_value</SPAN
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
></BODY
></BODY
></HTML
></HTML
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.