有没有办法像 C 语法 /* */
一样注释掉 makefile 中的多行?
最佳答案
不,makefile 中没有类似 C 风格的 /* */
注释。正如其他人所建议的,您可以通过使用行延续来进行多行注释。例如:
# This is the first line of a comment \
and this is still part of the comment \
as is this, since I keep ending each line \
with a backslash character
但是,我想您可能出于调试原因暂时注释掉 makefile 的一部分,并且在每一行上添加反斜杠并不实际。如果您使用 GNU make,我建议您使用带有故意错误表达式的 ifeq
指令。例如:
ifeq ("x","y")
# here's all your 'commented' makefile content...
endif
关于makefile - 如何在makefile中添加多行注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4493291/