禁止“对“全部"不做任何事情" [英] Suppress "nothing to be done for 'all' "
问题描述
我正在编写一个简短的shell脚本,该脚本称为"make all".这不是很关键,但是如果是这样的话,有没有办法我可以抑制什么都做不了"的信息呢?我希望找到一个标记来抑制这种情况(不确定是否有一个标记),但是另外一行或两行代码也可以工作.
I am writing a short shell script which calls 'make all'. It's not critical, but is there a way I can suppress the message saying 'nothing to be done for all' if that is the case? I am hoping to find a flag for make which suppresses this (not sure there is one), but an additional line or 2 of code would work too.
仅供参考,我正在使用bash.
FYI I'm using bash.
更清楚地说,我只想支持无事可做的消息.否则,我想显示输出.
to be more clear, I only want to suppess messages that therer is nothing to be done. Otherwise, I want to display the output.
推荐答案
您可以将全部"作为PHONY目标(如果尚未实现),该目标具有实际目标,并且可以进行一些不起眼的事情:>
You can make "all" a PHONY target (if it isn't already) which has the real target as a prerequisite, and does something inconspicuous:
.PHONY: all
all: realTarget
@echo > /dev/null
这篇关于禁止“对“全部"不做任何事情"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!