bug-make
[Top][All Lists]
Advanced

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

Re: Help : how to use $(or condition ) & $(and condition ) in makefiles


From: rakesh aggarwal
Subject: Re: Help : how to use $(or condition ) & $(and condition ) in makefiles
Date: Thu, 5 Jun 2008 23:46:48 -0700 (PDT)

Hi sam,

Very very thanks for your valuable suggestion.

I have one debut that I am explaining through this example.

I have 2 variable (let assume A and B) which contain some value.

I want to test A==2 and B==4 using $(and condition) function.

How can I put this condition in function??

I want only different output for the situation when any of the condition is wrong (either A != 2 or B != 4) and both  are  right  (A ==2 and B==4 ).

result := $(and  condition )

$(warning   result=$(result))

Regards
Rakesh




--- On Thu, 6/5/08, Sam Ravnborg <address@hidden> wrote:
From: Sam Ravnborg <address@hidden>
Subject: Re: Help : how to use $(or condition ) & $(and condition ) in makefiles
To: "rakesh aggarwal" <address@hidden>
Cc: address@hidden
Date: Thursday, June 5, 2008, 11:28 PM

On Thu, Jun 05, 2008 at 05:36:56AM -0700, rakesh aggarwal wrote:
> Hi,
>
> I read the GNU make manual and found there are $(or condition ) and $(and
condition ) functions. ( at
http://www.gnu.org/software/make/manual/make.html#Conditional-Functions )
> But i didnt get in which format i have to put conditions in these
functions.

Notice that this is condition and not expressions.

Sample:

havefile := $(if $(wildcard myfile.c), YES, NO)

$(warning HAVEFILE=$(HAVEFILE))


This will print
HAVEFILE=NO

if no myfile.c exist (because the $(wildcard myfile.c) expands to an empty
string

Sam


reply via email to

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