Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using <strong><code>=</code></strong> causes the variable to be assigned a value. If the variable already had a value, it is replaced. This value will be expanded when it is used. For example:</p> <pre><code>HELLO = world HELLO_WORLD = $(HELLO) world! # This echoes "world world!" echo $(HELLO_WORLD) HELLO = hello # This echoes "hello world!" echo $(HELLO_WORLD) </code></pre> <p>Using <strong><code>:=</code></strong> is similar to using <code>=</code>. However, instead of the value being expanded when it is used, it is expanded during the assignment. For example:</p> <pre><code>HELLO = world HELLO_WORLD := $(HELLO) world! # This echoes "world world!" echo $(HELLO_WORLD) HELLO = hello # Still echoes "world world!" echo $(HELLO_WORLD) HELLO_WORLD := $(HELLO) world! # This echoes "hello world!" echo $(HELLO_WORLD) </code></pre> <p>Using <strong><code>?=</code></strong> assigns the variable a value <em>iff</em> the variable was not previously assigned. If the variable was previously assigned a blank value (<code>VAR=</code>), it is still considered set <em>I think</em>. Otherwise, functions exactly like <code>=</code>.</p> <p>Using <strong><code>+=</code></strong> is like using <code>=</code>, but instead of replacing the value, the value is appended to the current one, with a space in between. If the variable was previously set with <code>:=</code>, it is expanded <em>I think</em>. The resulting value is expanded when it is used <em>I think</em>. For example:</p> <pre><code>HELLO_WORLD = hello HELLO_WORLD += world! # This echoes "hello world!" echo $(HELLO_WORLD) </code></pre> <p>If something like <code>HELLO_WORLD = $(HELLO_WORLD) world!</code> were used, recursion would result, which would most likely end the execution of your Makefile. If <code>A := $(A) $(B)</code> were used, the result would not be the exact same as using <code>+=</code> because <code>B</code> is expanded with <code>:=</code> whereas <code>+=</code> would not cause <code>B</code> to be expanded.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload