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