help-make
[Top][All Lists]
Advanced

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

Re: Evaluation of variables inside make rules' dependencies


From: Dmitry N. Mikushin
Subject: Re: Evaluation of variables inside make rules' dependencies
Date: Thu, 10 Mar 2011 05:52:22 +0300

Ok, but could you recommend an approach for packing multiple libraries with a 
single rule, that supports varying sources list and flags? Or is this method 
not of your taste in general?

----- Original message -----
> On 3/9/11, Dmitry N. Mikushin <address@hidden> wrote:
> ...
> > %.a: INCLUDES += $($(LIBNAME)_INCLUDES)                             <--- (1)
> > %.a: dirs $$(OBJECTS)
> >     @echo Packing static library $@ ... $(INCLUDES)                         
> >     <---(2)
> >     @$(AR) $(ARPARAMS) $@ $(OBJECTS)
> > 
> > $(STORE)/%.c.o: %.c
> >     @echo Creating object file for $< ...
> >     $(CCOMP) $(CPARAMS) $(DEFINES) $(INCLUDES) -c $< -o address@hidden      
> >               
> > <--- (3)
> > 
> > Here at (1) INCLUDES is expanded with library-specific values, and
> > changes are visible at (2), but not applied at (3). It turns all
> > variables defined in %.a are recomputed in %.c.o with respect to new
> > $@, and all information I need to pass from %.a to %.c.o via variables
> > is lost. Is there a workaround to deliver %.a's values to %.c.o?
> 
> Sorry, I personally dislike and do not use variable inheritance, so I
> don't have any good ideas on how to force it to continue to take
> effect here.
> 
> 
> Philip Guenther



reply via email to

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