[Omake] multiple generator invokation
Aleksey Nogin
anogin at hrl.com
Fri Jul 27 14:33:48 PDT 2007
On 27.07.2007 14:10, Sam Steingold wrote:
> $(R_GEN) : ./tools/gen_foo.exe
> foreach($(my_save), $@)
> $< -by_type -tp foo_tick.ml -ut $(UTDEST)/ut_foo.ml \
> -map $(UTDEST)/map_foo.ml
> foreach($(my_diff), $@)
>
> I noticed that the generator ./tools/gen_foo.exe is invoked 6(!) times
> in quick succession (few seconds). why?
The issue is how the rules with multiple targets work - there is a
_separate_ rule for each target, and the rules get merged together if
all the commands and dependencies are the same.
Consider for example:
foo bar:
touch $@
This would actually create two separate rules:
foo: :effects: bar
touch foo
bar: :effects: foo
touch bar
(where the :effects: part makes sure the two would never run in parallel).
If the $@ is not explicitly present in the rule test, different rules
will get created, but only the first will run - when OMake will come
around to run the subsequent ones, it will see that there is nothing new
that needs to be done.
--
Aleksey Nogin, Research Scientist
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA
More information about the Omake
mailing list