1 # SPDX-License-Identifier: GPL-2.0
4 warning = $(warning-if,y,$(1))
6 # You can not pass commas directly to a function since they are treated as
7 # delimiters. You can use the following trick to do so.
9 $(warning,hello$(comma) world)
11 # Like Make, single quotes, double quotes, spaces are treated verbatim.
12 # The following prints the text as-is.
13 $(warning, ' " '" ' ''' "'")
15 # Unlike Make, '$' has special meaning only when it is followed by '('.
16 # No need to escape '$' itself.
22 # You need a trick to escape '$' followed by '('
23 # The following should print "$(X)". It should not be expanded further.
25 $(warning,$(dollar)(X))
27 # You need a trick to treat unbalanced parentheses.
28 # The following should print "(".
30 $(warning,$(left_paren))
32 # A simple expanded should not be expanded multiple times.
33 # The following should print "$(X)". It should not be expanded further.
37 # The following should print "$(X)" as well.
41 # The following should print "$(".
42 # It should not be emit "unterminated reference" error.
43 unterminated := $(dollar)(
44 $(warning,$(unterminated))