[Omake] The % variable

Alain Frisch alain.frisch at lexifi.com
Tue Dec 4 10:30:53 PST 2007


Hello,

I'd like to call the built-in function "filter" from a function
which is itself called from a rule:

ComputeCFLAGS(file) =
   TAGS = $(filter %.tag, $(dependencies $(file)))
   echo TAGS for $(file) "///" $(TAGS) "///" %
   value $(CFLAGS)

%$(EXT_OBJ): %.c :scanner: scan-c-%.c
     $(CC) $(ComputeCFLAGS $@) $(PREFIXED_INCLUDES) -c $(CCOUT)$@ $<


(The idea is to implement ocamlbuild-like tags using the technique
suggested by Jason to collect global information:
http://lists.metaprl.org/pipermail/omake/2007-October/001907.html
)

The code above does not work because the % symbol in the call to filter
is bound by the implicit rule. Is it the intended behavior?

1. I'd find it more natural if the % symbol were bound only in the
syntactical body of the rule, not in its dynamic scope.

2. I'd also find it more natural if % in the call the filter behaved
always as a binder, even when % is already bound.


Anyway, is there a way to use the filter function when the % symbol is
already bound?


   Alain






More information about the Omake mailing list