On Tue, Oct 28, 2003 at 12:21:49PM +0900, Dominique DEUFF wrote:
> 
>       Hello,
> 
>       I have to rebuild a project with the makefile I join at the end.
>       I obtain this error :
>               makefile:71: *** Recursive variable `LIBS' references itself
> (eventually).  Stop
> 
>       Does anyone know a solution to this ? 

There are two types of assignments.

LIBS    = file.a

Result in late evaluation. What is to the right of '=' is evaluated only
when LIBS is referenced. With late evaluation a variable cannot
reference itself - that the problem you see.
Late evaluation is required when for example using the following:
VAR     = $@
What to realise is that the value of $@ differ with the context where the
variable is used - therefore late evaluation is required.
But most often this is not the case, so I generally prefer the second type
of assignment in my makefiles.


LIBS    := file.a

Result in early evaluation. Here LIBS is immediately assigned the value of
file.a. Use this type of assignment and your problem is solved.

        Sam


_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make

Reply via email to