Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 
0003 # 'info' prints the argument to stdout.
0004 $(info,hello world 0)
0005 
0006 # 'warning-if', if the first argument is y, sends the second argument to stderr,
0007 # and the message is prefixed with the current file name and line number.
0008 $(warning-if,y,hello world 1)
0009 
0010 # 'error-if' is similar, but it terminates the parsing immediately.
0011 # The following is just no-op since the first argument is not y.
0012 $(error-if,n,this should not be printed)
0013 
0014 # Shorthand
0015 warning = $(warning-if,y,$(1))
0016 
0017 # 'shell' executes a command, and returns its stdout.
0018 $(warning,$(shell,echo hello world 3))
0019 
0020 # Every newline in the output is replaced with a space,
0021 # but any trailing newlines are deleted.
0022 $(warning,$(shell,printf 'hello\nworld\n\n4\n\n\n'))
0023 
0024 # 'filename' is expanded to the currently parsed file name,
0025 # 'lineno' to the line number.
0026 $(warning,filename=$(filename))
0027 $(warning,lineno=$(lineno))