bug-make
[Top][All Lists]
Advanced

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

Re: Why "*** extraneous `endef'. Stop."?


From: Tim Murphy
Subject: Re: Why "*** extraneous `endef'. Stop."?
Date: Sun, 6 Sep 2009 13:15:28 +0100

Hi,

define starts a macro.  Everything from the start of the macro to
endef is just text and is not evaluated.

So your inner "define" is not recognised - it's just treated as text.
That means that the dirst endef matches the first define and all the
other endefs seem to have no corresponding define statement.

In other words, you cannot nest defines like that.

Also note that ifneq doesn't have any effect inside a define - it only
has an effect when you $(eval) the macro.

Cheers,


Tim


2009/9/6 Sergey Zubkovsky <address@hidden>:
> Hi,
> Why the below makefile fails with the error text "_Makefile:16: ***
> extraneous `endef'.  Stop._"?
> Thanks.
>
> #-----------------------------------
> *define Var1
> ifneq (1,1)
> define Var2
> define Var3
> endef
> endef
> endif
> endef
>
> .PHONY : EmptyTarget
> EmptyTarget : ;
>
> $(eval $(value Var1))*
> #-----------------------------------
>
>
>
> _______________________________________________
> Bug-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-make
>



-- 
You could help some brave and decent people to have access to
uncensored news by making a donation at:

http://www.thezimbabwean.co.uk/




reply via email to

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