[Omake] Dependencies on generated tools

Aleksey Nogin anogin at hrl.com
Tue Apr 10 14:09:30 PDT 2007


Jonathan,

The issue is not that you _can_ use both to compile .mli files, but 
rather what the OCaml.om will actually try to use (unless you override it).

But you are right - OCaml.om will always use ocamlc for compiling the 
.mli files (even if BYTE_ENABLED is false) and while it might use 
ocamlopt to build .cmi out of an .ml which does not have a corresponding 
.mli, the "%.cmx: $(OCAMLOPT)" dependency would make it work correctly.

So, yes,

%.cmi %.cmo: $(OCAMLC)
%.cmx: $(OCAMLOPT)

should be sufficient.

P.S. Actually, OMake should probably be capable of extracting these 
dependencies automatically - the dependency on, at least, the existence 
of the executable should always be there. I've filed 
http://bugzilla.metaprl.org/show_bug.cgi?id=664 on that.

Aleksey

On 09.04.2007 15:47, Jonathan Roewen wrote:

> Why do you need the if tests? (Not that I use ocamlopt...)
> 
> Afaik, you can use either ocamlc or ocamlopt to compile .mli files to
> .cmi files for both native & bytecode modes.
> 
[...]
>> Yes, the implicit dependencies is the proper way of doing that. If you
>> are overriding both OCAMLOPT and OCAMLC, then you probably want
>> something like
>>
>> .SUBDIRS: toolchain
>> ...
>>
>> %.cmo: $(OCAMLC)
>> %.cmx: $(OCAMLOPT)
>> if $(BYTE_ENABLED)
>>    %.cmi: $(OCAMLC)
>>    export
>> if $(NATIVE_ENABLED)
>>    %.cmi: $(OCAMLOPT)
>>    export
>>
>> Note that the implicit dependencies are scoped in the normal fashion, so
>> you need the "export" statements above.


-- 
Aleksey Nogin, Research Staff Member
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA


More information about the Omake mailing list