gpt4 book ai didi

makefile - makefile 中多行列表中的注释

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

我想要类似的东西

BROKEN_THINGS = \ 
thing1 \ # thing1 is completely broken
thing2 \ # thing2 is broken too, see BUG-123

看起来这对 [g]make 是不可能的。

我最终使用了 warning函数(这是有效的,因为 $(warning X) 总是返回空字符串):
BROKEN_THINGS = \
thing1 $(warning "thing1 is completely broken") \
thing2 $(warning "thing2 is broken too, see BUG-123") \

最后一个并不理想,因为警告会混淆 make 的输出(而且 warning 是特定于 gmake 的)。

是否有更好的解决方案来记录长长的多行列表?

最佳答案

您可以使用:

BROKEN_THINGS =
BROKEN_THINGS += thing1 # thing1 is completely broken
BROKEN_THINGS += thing2 # thing2 is broken too, see BUG-123

关于makefile - makefile 中多行列表中的注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22322317/

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