help-make
[Top][All Lists]
Advanced

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

Re: Syntax's in make file.


From: Paul D. Smith
Subject: Re: Syntax's in make file.
Date: Wed, 29 Jan 2003 09:51:24 -0500

%% Alex Shprukh <address@hidden> writes:

  as> 1.How I can use boolean expression and  in condition ifeq

You can't, not directly.  Depending on the expression you want you can
do it with ifeq itself though.

For example if you want to verify that FOO == foo and BAR == bar, you
can do something like:

  ifeq ($(FOO) $(BAR),foo bar)

    ...

  endif

  as> 2.Some times this rule work in sometime not .What is wrong here:

Since you don't say what "works" and "doesn't work" means, and you don't
give any idea when it works and when it doesn't, that's hard to say.

  as> exportToInvision:

  as>     cd ${RAPP}/exportToInvision; \

  as>     $(RMAKE) $(RFLAGS) ${GENMAK} ${RDO}

  as>     ifeq "${OSNAME}" "SunOS"

Any line that starts with a TAB, _regardless_ of what's in it, is passed
to the shell.  Any line that does not start with a TAB, _regardless_ of
what's in it, is interpreted by make (continued lines are part of the
previous line and obey its rules).

So, if you want to use make's ifeq operation you must be sure that the
line does not start with a TAB, or make will simply pass it to the
shell rather than interpreting it.

  as>     cd ${RAPP}/exportToInvision; \

  as>     ${CM} depend all

  as>     endif

-- 
-------------------------------------------------------------------------------
 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]