yocto-public/2-usage/syntax.md

53 lines
1.0 KiB
Markdown

# Configuration file syntax
```sh
# VAR value (the brackets are mandatory)
${VAR}
# Set value if not defined (ie set default value)
VAR ?= "defvalue"
# Set value at the end of parsing if the value is not defined
VAR ??= "defvalue"
# Set VAR to "value" immediately
VAR := "value"
# Append "value" to VAR
# Warning: inserts a space between current value and appended value
VAR += "value"
# Same with prepend:
VAR =+ "value"
# Same to append/prepend but without space
VAR .= "value"
VAR =. "value"
# Same to append/prepend
# but without space and deferred at the end of parsing
VAR_append = "value"
VAR_prepend = "value"
# Remove elements (words) in a space-separated value list
VAR_remove = "value"
# Like bash functions
my_function() {
echo "Hello world"
}
# Note that _append suffix also works with functions
# Function written in python
python my_function2() {
print "Hello world"
}
```
<warn data-markdown>
- `${VAR}` is a Yocto variable.
- `$VAR` is a shell variable.
- They are very different !
</warn>