make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to use logical OR on makefile conditionals


From: Paul D. Smith
Subject: Re: how to use logical OR on makefile conditionals
Date: Mon, 29 Mar 2004 11:44:07 -0500

%% address@hidden writes:

  la> Is there a way to use logical OR on a makefile 
  la> Something like: 

  la> ifeq ($(A),$(B) || $(A),$(C)) , 
  la> or 
  la> ifeq ($(A),$(B))  || ifeq ($(A),$(C)) 

As I'm sure you've seen from the GNU make manual, there is no logical OR
in makefile syntax.


You have to use filter:

  ifneq (,$(filter $(A),$(B) $(C)))

The filter will return B and/or C if they match A, and the ifneq empty
string will be true if the filter returns any value.

Note this only works if A, B, and C consist of a single word.  If not
you'll have to get even fancier, using something built around
$(subst ...) probably.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]