Makefile 将ifeq与多个选项一起使用

Makefile 将ifeq与多个选项一起使用,makefile,gnu-make,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 ($(filter $(cond1) $(cond2),yes),) x := 2 else x := 1 endif ifeq ($

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

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

请建议正确的方法

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

ifeq ($(filter $(cond1) $(cond2),yes),)
    x := 2
else  
    x := 1
endif 
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
可能重复的