[Omake] More on ocamldep and generated files.

Francois Pottier Francois.Pottier at inria.fr
Wed Jun 14 02:35:30 PDT 2006


Dear Jason,

On Tue, Jun 13, 2006 at 06:20:39PM -0700, Jason Hickey wrote:

> I added support for this on the 0.9.8.ocamldep branch.  I'm fairly sure 
> it is stable, but we should examine it more closely before merging to 
> the trunk.  The relevant parts are:
>    - the find-targets-in-path-optional(<path>, <filenames>) finds
>      the specified targets, even if the files do not exist yet.
>    - the ML scanner calls ocamldep with the -modules option, and
>      pipes it to an internal postprocessor.  This is all done
>      in OCaml.om

Have you thought about the situation where a module has an .mli file but no
.ml file? In this situation, things seem to work when producing bytecode but
fail when compiling to native code. Here is an excerpt of omake's output:

    - scan . scan-ocaml-anf.ml
    + ocamlrun /usr/local/bin/ocamldep-omake -I . -native -modules anf.ml
	 | Shell.ocamldep-postproc()
    *** omake: 45/247 targets are up to date
    *** omake: failed (0.9 sec, 17/17 scans, 2/3 rules, 106/229 digests)
    *** omake error:
       File /usr/local/lib/omake/build/OCaml.om: line 335, characters 1-18
       Do not know how to build "typed.cmx" required for "anf.o"
    $ ~/0.9.8.ocamldep/src/main/omake
    *** omake: reading OMakefiles
    *** omake: finished reading OMakefiles (0.0 sec)
    *** omake: 45/247 targets are up to date
    *** omake: failed (0.0 sec, 0/17 scans, 0/3 rules, 0/179 digests)
    *** omake error:
       File /usr/local/lib/omake/build/OCaml.om: line 335, characters 1-18
       Do not know how to build "typed.cmx" required for "anf.o"

Here, the source file is typed.mli, there is no typed.ml. So, omake should
not attempt to build typed.cmx; instead, it should build typed.cmi. The
call to ocamldep works: it produces

    $ ocamlrun /usr/local/bin/ocamldep-omake -I . -native -modules anf.ml
    anf.ml:
	    Annotation
	    Layout
	    Lazy
	    List
	    Location
	    Primitive
	    Print
	    Printf
	    Source
	    SymbolTable
	    Typed
	    Valfun
	    Var

So I'm guessing that your internal postprocessor is the culprit.

-- 
François Pottier
Francois.Pottier at inria.fr
http://cristal.inria.fr/~fpottier/


More information about the Omake mailing list