help-make
[Top][All Lists]
Advanced

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

Re: if-conditionals


From: Noel Yap
Subject: Re: if-conditionals
Date: Mon, 13 Dec 2004 11:29:43 -0500
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

address@hidden wrote:

Hi,

I have 3 questions related to if-conditionals:

1) I wonder, why are there never spaces after commas in the manual, like for example here: ifeq ($(CC),gcc).
   Is it OK to put spaces after commas (I guess yes)?

Spaces are allowed but depending on what you want, it may not be the correct 
thing to do; they are used as part of the match.

2) How do you test for OR-conditions?

ifneq ($(if $(a-condition),1)$(if $(another-condition),1),)
endif

3) How do you search for a string, ignoring the case?

Create a user function like to-lower and compare the output of that.

4) http://www.gnu.org/software/make/manual/html_node/make_77.html
says "Extra spaces are allowed and ignored at the beginning of the conditional directive line, but a tab is not allowed." Does it mean the tab in front of "if" word or also in the statements (i.e. may I indent the CXXFLAGS below)?

Tabs should only exist within actions.

Sorry, I don't have time to go through your makefile but hopefully the above is 
enough to go on.

BTW, to use user functions, you'll need 3.80 or above.

HTH,
Noel




reply via email to

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