Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] make
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] make
> I have a problem with writing makefiles for OCaml and with compilation
> order. Probably a FAQ.
>
> Searching the caml-list archives I've found info about a tool by
> Nicolas Cannesse (ocamake) that can be used to compile a set of ml
> files into an executable or to generate a makefile such that a
> subsequent make command will construct the executable. However this is
> not quite what I want.
[...]
> Does such a tool exists? Does ocamldep already knows to do this and I
> didn't found it in the docs? Thanks.

This is not a FAQ and still an open problem.
OCamldep is working at the syntax level but does not differenciate between
the usage of a module *type* (so a compilation dependency : the MLI of the
module need to be compiled first) and the usage of a module *value* ( so a
compilation + runtime dependency : the MLI needs to be compiled first AND
the module linked first). Thus unless you rewrite your ocamldep you cannot
get enough information to correctly sort the CMO into the good order.
However ocamake is applying some algorithms in order to "guess" which order
might be valid in cases of conflict . A case of conflict arise when we
reduce the ML+MLI ocamldep graph output into a CMO only graph, merging ML
and MLI nodes, and thus sometimes creating cycles while there *is* a valid
compilation order.
Instead of doing again the job you might try to use the Makefile generation
from ocamake, or simply tweak it in order to make it output the linkage
order it found.

Regards,
Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners