Hi GNU Team,
 
                   I tried the following, but it does not seem to work.Can you 
please help ?

dmss : copy_bmp_cefs

USES_BMP_CEFS=yes
USES_EFS=yes

copy_bmp_cefs:
ifeq ($(USES_BMP_CEFS), yes)
    @echo ------------------------------------------------------------------
    if [ "$(USES_EFS)" = yes ]; then \
    $(bmp_cefs); \
    fi
    @echo ------------------------------------------------------------------
endif


define bmp_cefs
    @echo #------------------------------------------------------------------
    @echo Copying BMP CEFS image .....
    @echo Done Copying BMP CEFS image 
    @echo #------------------------------------------------------------------
endef

With regards,
Rajdeep R. Lodh

--- On Thu, 26/3/09, Paul Smith <[email protected]> wrote:

From: Paul Smith <[email protected]>
Subject: Re: Fw: [gnu.org #422525] Passing conditional expression to shell in a 
make file?
To: "rajdeep lodh" <[email protected]>
Cc: [email protected]
Date: Thursday, 26 March, 2009, 10:41 PM

On Thu, 2009-03-26 at 21:50 +0530, rajdeep lodh wrote:
> 
>                     Can you please let me know if this is possible and
> the syntax for the same ?
> 
>         > ifeq
>         > ($(USES_BMP_CEFS), yes)
>         > 
>         >           �...@echo
>         > ------------------------------------------------------------------
>         > 
>         >             ifeq
>         > ($(USES_EFS) ,  yes)
>         > 
>         >             $(bmp_cefs)
>         > 
>         >             endif
>         > 
>         >           �...@echo
>         > ------------------------------------------------------------------

Hi Rajdeep.

Questions about working with GNU make are best sent to the
[email protected] mailing list.

In your particular case above, note that you cannot put make
conditionals (like ifeq etc.) into a recipe (command lines beginning
with TAB): recipe lines are passed to the shell for execution.  Make
does not do any parsing whatsoever on those lines except to expand
variables and functions.  It definitely does NOT handle make
conditionals like ifeq.

If you want to use an if-statement inside a recipe, you have to use the
shell's syntax for conditionals.  So it would be something like:

    @echo ------------------------------------
    if [ "$(USES_EFS)" = yes ]; then \
            $(bmp_cefs); \
        fi
        @echo ------------------------------------

Further questions or requests for help should, as I mentioned, be
addressed tothe [email protected] mailing list.

Cheers!




      Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to