[Omake] Re: "filter" broken in new omake?
Aleksey Nogin
nogin at metaprl.org
Thu Dec 14 09:22:25 PST 2006
On 14.12.2006 01:23, David Kågedal wrote:
>> E.g.:
>>
>> %.o: %.c
>> res = $(filter %.bla, ...)
>> ...
>>
>> This will filter foo.bla rather than anything ending in ".bla" if "foo.o" is
>> the current target.
>
> You can probably use $* instead.
David, I think you misunderstood - he was trying to do the opposite -
instead of passing "whatever matched the % in the target" (which is what
he was getting already), he wanted to pass the _literal_ symbol "%" to
the filter function, so the solution was the opposite to what you are
proposing.
> Consider the following Makefile:
>
> foo-%-bar:
> echo $* > $@
>
> Running "make foo-xxx-bar" will run the command
>
> echo xxx > foo-xxx-bar
>
> In omake, the $* variable expands to $@ with the suffix stripped, if I
> understood correctly. This is much less useful.
>
Well, why is it less useful? Note that OMake provides you a way to get
_both_. If you want what make gives you, just use %. If you want OMake's
$*, you can get that too.
Things do become slightly tricky in presence of vmount, but we've fixed
some of the issues related to that recently.
Aleksey
More information about the Omake
mailing list