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 /documentation/dev-manual | |
parent | d57b5e514917593e5547a327d5306b42da4064d1 (diff) | |
download | openembedded-core-contrib-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>
Diffstat (limited to 'documentation/dev-manual')
-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 @@ or tabs after the slash character. </note> </para></listitem> - <listitem><para><emphasis>Using Variables: <filename>{...}</filename></emphasis> - + <listitem><para><emphasis>Using Variables: <filename>${...}</filename></emphasis> - Use the <filename>${<varname>}</filename> syntax to access the contents of a variable: <literallayout class='monospaced'> @@ -1615,6 +1615,30 @@ CFLAGS_prepend_sh4 = " file://fix-makefile.patch" </literallayout> </para></listitem> + <listitem><para><emphasis>Overrides:</emphasis> - + You can use overrides to set a value conditionally, + typically on how the recipe is being built. + For example, to set the + <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink> + variable's value to "standard/base" for any target + <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>, + except for qemuarm where it should be set to + "standard/arm-versatile-926ejs", you would do the + following: + <literallayout class='monospaced'> + KBRANCH = "standard/base" + KBRANCH_qemuarm = "standard/arm-versatile-926ejs" + </literallayout> + Overrides are also used to separate alternate values + of a variable in other situations. + For example, when setting variables such as + <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink> + and + <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>, + that are specific to individual packages produced by + a recipe, you should always use an override that + specifies the name of the package. + </para></listitem> <listitem><para><emphasis>Indentation:</emphasis> Use spaces for indentation rather than than tabs. For shell functions, both currently work. @@ -1623,13 +1647,13 @@ Realize that some layers have a policy to use spaces for all indentation. </para></listitem> - <listitem><para><emphasis>Using Python for Complex Operations: <filename>${@<variable>}</filename></emphasis> - + <listitem><para><emphasis>Using Python for Complex Operations: <filename>${@<python_code>}</filename></emphasis> - For more advanced processing, it is possible to use Python code during variable assignments (e.g. search and replacement on a variable).</para> <para>You indicate Python code using the - <filename>${@<variable>}</filename> syntax for the - variable assignment: + <filename>${@<python_code>}</filename> + syntax for the variable assignment: <literallayout class='monospaced'> SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz </literallayout> |