makefilegnu-make

Using ifeq with multiple options


I want check for a condition in makefile using ifeq, & not sure how to go about:

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

Please suggest the proper way to do it?


Solution

  • ifeq ($(filter $(cond1) $(cond2),yes),)
        x := 2
    else  
        x := 1
    endif