[Omake] Dependencies on generated tools

Aleksey Nogin anogin at hrl.com
Mon Apr 9 09:23:14 PDT 2007


On 08.04.2007 21:59, Nathaniel Gray wrote:

> You can use LocalOCamlGeneratedFiles($(OCAMLC)) in every subdir *except* for the toolchain subdir.

Note that this would be a bit too aggressive (since this defines a 
dependency for the _scanner_ rules, but the scanner rules do not really 
care about OCAMLC), so this is probably not what you want. Also, as 
Nathan said, LocalOCamlGeneratedFiles is likely to go away once the 
OCAMLDEP_MODULES stuff is working.

However, if you did want it, you should know that the 
LocalOCamlGeneratedFiles stuff is scoped like everything else, so you 
could define it right after ".SUBDIRS: toolchain" and have it be 
inherited by other subdirs.

> In fact, I think this would work just as well (though I 
> haven't tested it and my omake-fu is not terribly strong):
>     .SUBDIRS: toolchain
>     . . .
>     # After the toolchain subdir but before the others
>     %.cmi: $(OCAMLC)
>     %.cmx %.cmo: $(OCAMLC)
> 
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

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


More information about the Omake mailing list