bug-make
[Top][All Lists]
Advanced

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

Re: makefile:71: *** Recursive variable `LIBS' references itself (eventu


From: Sam Ravnborg
Subject: Re: makefile:71: *** Recursive variable `LIBS' references itself (eventually). Stop
Date: Tue, 28 Oct 2003 06:45:29 +0100
User-agent: Mutt/1.4.1i

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




reply via email to

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