Kconfig 900 B

123456789101112131415161718192021222324252627
  1. # SPDX-License-Identifier: GPL-2.0
  2. # 'info' prints the argument to stdout.
  3. $(info,hello world 0)
  4. # 'warning-if', if the first argument is y, sends the second argument to stderr,
  5. # and the message is prefixed with the current file name and line number.
  6. $(warning-if,y,hello world 1)
  7. # 'error-if' is similar, but it terminates the parsing immediately.
  8. # The following is just no-op since the first argument is not y.
  9. $(error-if,n,this should not be printed)
  10. # Shorthand
  11. warning = $(warning-if,y,$(1))
  12. # 'shell' executes a command, and returns its stdout.
  13. $(warning,$(shell,echo hello world 3))
  14. # Every newline in the output is replaced with a space,
  15. # but any trailing newlines are deleted.
  16. $(warning,$(shell,printf 'hello\nworld\n\n4\n\n\n'))
  17. # 'filename' is expanded to the currently parsed file name,
  18. # 'lineno' to the line number.
  19. $(warning,filename=$(filename))
  20. $(warning,lineno=$(lineno))