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