[Scummvm-devel] Release plans, once again

Max Horn max at quendi.de
Sun Aug 22 13:16:00 CEST 2004


Am 22.08.2004 um 21:59 schrieb Marcus Comstedt:

>
> Max Horn <max at quendi.de> writes:
>
>>> Secondly, I'll need to add another dependency to the dynamic plugin
>>> link rule; right now it depends on $(EXECUTABLE), but I need it to
>>> depend on a linker script generated _from_ $(EXECUTABLE).  Any
>>> suggestions for a name for the makefile variable to hold this extra
>>> dependency?
>>
>> Uhmpf... maybe PLUGIN_EXTRA_DEPS ? So something like this in Makefile
>>
>> PLUGIN_EXTRA_DEPS := $(EXECUTABLE)
>>
>> Then in the morphos additions for the Makefile
>> PLUGIN_EXTRA_DEPS += your_fancy_script
>>
>> And in common.rules
>> $(PLUGIN-$(MODULE)): $(MODULE_OBJS) $(PLUGIN_EXTRA_DEPS)
>> 	$(CXX) $(PLUGIN_LDFLAGS) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) -o $@
>>
>> (I am not sure if filter-out will work right this way, you gotta try
>> that one out, I guess).
>
> Hm, but why use the $(filter-out) thing at all?  Shouldn't just
> $(MODULE_OBJS) do the trick?
>
>
Nope, see also the comment at the bottom of common.rules -- at the time 
the "make" rule gets used, the value of MODULE_OBJS has already been 
changed (several times, in fact). That's because env vars in the make 
rule bodies only get evaluated at the time the rule is applied. OTOH, 
env vars which occur in the dependency list of a target get evaluated 
the moment they are encountered. Hence $+ contains the value of 
MODULE_OBJS (and PLUGIN_EXTRA_DEPS) from the moment the rule was loaded 
(i.e. the moment common.rules was included from scumm/module.mk, in 
this particular case).


Bye,

Max





More information about the Scummvm-devel mailing list