将ifeq与多个选项一起使用

Mon*_*lay 2 makefile gnu-make

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

ifeq ( cond1 = yes || cond2 = yes )   
  set value x = 1;   
else  
  set value x = 2;  
endif 
Run Code Online (Sandbox Code Playgroud)

请提出正确的做法吗?

Add*_*els 6

除了上面给出的正确答案之外:如果要检查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
Run Code Online (Sandbox Code Playgroud)