gpt4 book ai didi

makefile - 使用具有多个选项的 ifeq

转载 作者:行者123 更新时间:2023-12-03 06:27:16 27 4
gpt4 key购买 nike

我想使用 ifeq 检查 makefile 中的条件,并且不确定如何进行:

ifeq ( cond1 = yes || cond2 = yes )   
set value x = 1;
else
set value x = 2;
endif

请建议正确的方法?

最佳答案

除了上面给出的正确答案:如果你想检查 x=4 或 x=6

ifeq ($(x),$(filter $(x),4 6))   
x is either 4 or 6. do whatever you like with it
else
x is neither 4 nor 6
endif

关于makefile - 使用具有多个选项的 ifeq,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26625323/

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