gpt4 book ai didi

makefile - 如何在makefile中添加多行注释

转载 作者:行者123 更新时间:2023-12-03 04:46:41 25 4
gpt4 key购买 nike

有没有办法像 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com