|
From: | Oleksandr Gavenko |
Subject: | Re: AND, OR and NOT Operations |
Date: | Thu, 12 May 2011 10:26:16 +0300 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 |
On 11.05.2011 9:39, Ajay Jain wrote:
HI, I am finding it difficult to comprehend and, or and not operations in Make. What I would like to achieve is as follows: ifeq ("X","A)&& ifeq("X","B) ..&& ifeq ("X","Z") ... endif I need some permutations of&&, ||& ! operations. Though I do see the following in Manuals - $(or condition1[,condition2[,condition3...]]), $(and condition1[,condition2[,condition3...]]) but using them is a challenge.
There are many solutions. But they look not so clear as in C-lang notations. This for logical AND: ifeq 'yes' '$(DEBUG)' ifeq 'no' '$(OPTIM)' ... endif else ... endifFor logical OR operation you can use variable with 2 values - one empty (for false),
another anything (for true). After evaluating COND == 1 if COND1 or COND2 == 1: COND = ifeq '' '$(COND1)' COND = 1 endif ifeq '' '$(COND2)' COND = 1 endif Or shortly: ifneq '' '$(COND1)$(COND2)' # here if COND1 or COND2 are true endif So tips you can found in http://gmsl.sourceforge.net/ -- С уважением, Александр Гавенко.
[Prev in Thread] | Current Thread | [Next in Thread] |