@@ -172,6 +172,26 @@ assignment, ``BAR`` expands to the literal string "${FOO}" as long as
BAR = "${FOO}"
+Immediate variable expansion (:=)
+---------------------------------
+
+The ":=" operator results in a variable's contents being expanded
+immediately, rather than when the variable is actually used::
+
+ T = "123"
+ A := "test ${T}"
+ T = "456"
+ B := "${T} ${C}"
+ C = "cval"
+ C := "${C}append"
+
+In this example, ``A`` contains "test 123", even though the final value
+of :term:`T` is "456". The variable :term:`B` will end up containing "456
+cvalappend". This is because references to undefined variables are
+preserved as is during (immediate)expansion. This is in contrast to GNU
+Make, where undefined variables expand to nothing. The variable ``C``
+contains "cvalappend" since ``${C}`` immediately expands to "cval".
+
Setting a default value (?=)
----------------------------
@@ -235,26 +255,6 @@ After parsing we will have::
W = "xy"
-Immediate variable expansion (:=)
----------------------------------
-
-The ":=" operator results in a variable's contents being expanded
-immediately, rather than when the variable is actually used::
-
- T = "123"
- A := "test ${T}"
- T = "456"
- B := "${T} ${C}"
- C = "cval"
- C := "${C}append"
-
-In this example, ``A`` contains "test 123", even though the final value
-of :term:`T` is "456". The variable :term:`B` will end up containing "456
-cvalappend". This is because references to undefined variables are
-preserved as is during (immediate)expansion. This is in contrast to GNU
-Make, where undefined variables expand to nothing. The variable ``C``
-contains "cvalappend" since ``${C}`` immediately expands to "cval".
-
.. _appending-and-prepending:
Appending (+=) and prepending (=+) With Spaces
Move the immediate expansion section to be after the normal expansion section and before default value section. This improves the reading flow for two reasons: - the reader can compare it with normal expansion directly. - the weak default value section's example makes use of the immediate expansion operator, so it makes sense to already have it introduced at this point. Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- .../bitbake-user-manual-metadata.rst | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) --- base-commit: 18cca50ba3da5ce27bc674478957bb08e7536b9a change-id: 20260907-move-immediation-expansion-section-fb1dc5ca6544