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

标签 makefile gnu-make

我想使用 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/

相关文章:

c++ - 在 Linux 中创建的包含 make 文件的 Visual Studio 2015 中编译 C++ 项目

生成文件 : reading a file with 'pure make syntaxis' (no shell commands)

makefile - 抑制 make 规则错误输出

makefile - 的意义是什么 @!在制作文件中?

C Makefile - 如何避免重复提及文件名

c - GCC 无法识别文件内的目录路径

makefile - 如何在不带空格的makefile中的行间打断字符串?

file - 如何检查文件是否存在于 makefile 中

makefile - 为什么 GNU make 在末尾添加这个 'rm' 命令?

c - Makefile 不创建最终的可执行文件