What does the @[arguments]
syntax in a makefile mean? For example, I have come across a makefile that contains the following:
all: $(EXEC_NAME)
@[ -p video_fifo ] || mkfifo video_fifo
What does this do?
Nothing. You are parsing it incorrectly.
The leading @
is for make. It means "silence this command". See Recipe Echoing in the GNU make manual.
The rest of the line is a shell script. In this case it starts with a test [ -p video_fifo ]
(you often see this in the context of an if
statement if [ -n "$var" ]
or whatever see the bash manual for more about [
/ test
and for the -p
flag) and then || mkfifo video_fifo
|| mkfifo video_fifo
to create the video_fifo
fifo if the [
test returns false (hence the ||
OR operator).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.