diff options
author | Scott Rifenbark <scott.m.rifenbark@intel.com> | 2014-06-02 17:54:51 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-06-18 10:30:44 +0100 |
commit | 95a5fadc15e1cf297023a0592b65791d59d29807 (patch) | |
tree | 7b0a72a97eed57ab95f30ef0093891ad95b28b98 | |
parent | d57b5e514917593e5547a327d5306b42da4064d1 (diff) | |
download | poky-95a5fadc15e1cf297023a0592b65791d59d29807.tar.gz |
dev-manual: Edits to the "Understanding Recipe Syntax" section.
Added a new "Overrides" bullet item and fixed some minor issues
pointed out by Paul Eggleton.
(From yocto-docs rev: 44ff3d82985fa304c5641570fe72cf6a8ddabaa3)
Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 6ae7730f81..8b2613aa12 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -1498,7 +1498,7 @@ | |||
1498 | or tabs after the slash character. | 1498 | or tabs after the slash character. |
1499 | </note> | 1499 | </note> |
1500 | </para></listitem> | 1500 | </para></listitem> |
1501 | <listitem><para><emphasis>Using Variables: <filename>{...}</filename></emphasis> - | 1501 | <listitem><para><emphasis>Using Variables: <filename>${...}</filename></emphasis> - |
1502 | Use the <filename>${<varname>}</filename> syntax to | 1502 | Use the <filename>${<varname>}</filename> syntax to |
1503 | access the contents of a variable: | 1503 | access the contents of a variable: |
1504 | <literallayout class='monospaced'> | 1504 | <literallayout class='monospaced'> |
@@ -1615,6 +1615,30 @@ | |||
1615 | CFLAGS_prepend_sh4 = " file://fix-makefile.patch" | 1615 | CFLAGS_prepend_sh4 = " file://fix-makefile.patch" |
1616 | </literallayout> | 1616 | </literallayout> |
1617 | </para></listitem> | 1617 | </para></listitem> |
1618 | <listitem><para><emphasis>Overrides:</emphasis> - | ||
1619 | You can use overrides to set a value conditionally, | ||
1620 | typically on how the recipe is being built. | ||
1621 | For example, to set the | ||
1622 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink> | ||
1623 | variable's value to "standard/base" for any target | ||
1624 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>, | ||
1625 | except for qemuarm where it should be set to | ||
1626 | "standard/arm-versatile-926ejs", you would do the | ||
1627 | following: | ||
1628 | <literallayout class='monospaced'> | ||
1629 | KBRANCH = "standard/base" | ||
1630 | KBRANCH_qemuarm = "standard/arm-versatile-926ejs" | ||
1631 | </literallayout> | ||
1632 | Overrides are also used to separate alternate values | ||
1633 | of a variable in other situations. | ||
1634 | For example, when setting variables such as | ||
1635 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink> | ||
1636 | and | ||
1637 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>, | ||
1638 | that are specific to individual packages produced by | ||
1639 | a recipe, you should always use an override that | ||
1640 | specifies the name of the package. | ||
1641 | </para></listitem> | ||
1618 | <listitem><para><emphasis>Indentation:</emphasis> | 1642 | <listitem><para><emphasis>Indentation:</emphasis> |
1619 | Use spaces for indentation rather than than tabs. | 1643 | Use spaces for indentation rather than than tabs. |
1620 | For shell functions, both currently work. | 1644 | For shell functions, both currently work. |
@@ -1623,13 +1647,13 @@ | |||
1623 | Realize that some layers have a policy to use spaces | 1647 | Realize that some layers have a policy to use spaces |
1624 | for all indentation. | 1648 | for all indentation. |
1625 | </para></listitem> | 1649 | </para></listitem> |
1626 | <listitem><para><emphasis>Using Python for Complex Operations: <filename>${@<variable>}</filename></emphasis> - | 1650 | <listitem><para><emphasis>Using Python for Complex Operations: <filename>${@<python_code>}</filename></emphasis> - |
1627 | For more advanced processing, it is possible to use | 1651 | For more advanced processing, it is possible to use |
1628 | Python code during variable assignments (e.g. | 1652 | Python code during variable assignments (e.g. |
1629 | search and replacement on a variable).</para> | 1653 | search and replacement on a variable).</para> |
1630 | <para>You indicate Python code using the | 1654 | <para>You indicate Python code using the |
1631 | <filename>${@<variable>}</filename> syntax for the | 1655 | <filename>${@<python_code>}</filename> |
1632 | variable assignment: | 1656 | syntax for the variable assignment: |
1633 | <literallayout class='monospaced'> | 1657 | <literallayout class='monospaced'> |
1634 | SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz | 1658 | SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz |
1635 | </literallayout> | 1659 | </literallayout> |