Kconfig 1.2 KB

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