[Omake] Same command executed several times
Alain Frisch
alain.frisch at lexifi.com
Wed Oct 3 06:00:07 PDT 2007
Hello,
Let's consider a directory with two files sig.ml and sig.mli, and this
OMakefile:
.PHONY: clean
clean:
rm -f *.cm* *.obj
Sometimes, when I do: "omake clean && omake --no-S --no--progress -j 1
sig.cmx", I get:
- build . sig.cmi
+ ocamlc.opt -warn-error A -g -I . -c sig.mli
- build . sig.obj
+ ocamlopt.opt -warn-error A -I . -c sig.ml
- build . sig.cmx
+ ocamlopt.opt -warn-error A -I . -c sig.ml
*** omake: done (0.16 sec, 0/2 scans, 3/3 rules, 3/96 digests)
and sometimes (more often) I get:
- build . sig.cmi
+ ocamlc.opt -warn-error A -g -I . -c sig.mli
- build . sig.obj
+ ocamlopt.opt -warn-error A -I . -c sig.ml
*** omake: done (0.13 sec, 0/2 scans, 2/3 rules, 2/92 digests)
In the first case, the same command is executed several times. Note that
there is no parallel build, so I'd expect the sequence of commands to be
deterministic. Does anyone know what's going on? Again, this is under
Windows. (When I use -j 16, the problem occurs more often.)
Btw, looking at the code duplication in the implicit rules for compiling
OCaml code, I wonder if it wouldn't be a good idea to have a way to
implicitly inject rules as soon as one of the specified targets is
wanted. E.g. something like:
%.cmi %.cmo %.obj %.cmx:
if (...)
section rule
%.cmi: %.mli :scanner: scan-ocaml-%.mli
$(OCamlC) -c $<
...
else
section rule
...
could be interpreted as: when a target of the form
%.cmi/%.cmo/%.obj/%.cmx is needed, evaluate the body and inject all the
computed rules.
-- Alain
More information about the Omake
mailing list