1 # SPDX-License-Identifier: GPL-2.0
4 warning = $(warning-if,y,$(1))
6 # Simply expanded variable.
10 $(warning,SIMPLE = $(SIMPLE))
12 # Recursively expanded variable.
16 $(warning,RECURSIVE = $(RECURSIVE))
18 # Append something to a simply expanded variable.
22 $(warning,SIMPLE = $(SIMPLE))
24 # Append something to a recursively expanded variable.
28 $(warning,RECURSIVE = $(RECURSIVE))
30 # Use += operator to an undefined variable.
31 # This works as a recursively expanded variable.
33 UNDEFINED_VARIABLE += $(Y)
35 $(warning,UNDEFINED_VARIABLE = $(UNDEFINED_VARIABLE))
37 # You can use variable references for the lefthand side of assignment statement.
43 # User-defined function.
44 greeting = $(1), my name is $(2).
45 $(warning,$(greeting,Hello,John))
47 # The number of arguments is not checked for user-defined functions.
48 # If some arguments are optional, it is useful to pass fewer parameters.
49 # $(2) will be blank in this case.
50 $(warning,$(greeting,Hello))
52 # Unreferenced parameters are just ignored.
53 $(warning,$(greeting,Hello,John,ignored,ignored))