English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] ocamldep problem with .cmo vs .cmx
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-07 (10:41)
From: Alain Frisch <frisch@c...>
Subject: Re: [Caml-list] ocamldep problem with .cmo vs .cmx
On Wed, 7 Aug 2002, Henri Dubois-Ferriere wrote:

> So the question is:
> In the example above, why doesn't ocamldep output
> main.cmo: mylib.cmo
> instead of
> main.cmo: mylib.cmi

Because you don't need to rebuild main.cmo when you change the
implementation of Mylib (the link between the two modules is
resolved at ... link time). Native-code compilation performs
some cross-modules optimizations (not sure, but probably constant
propagation and function inlining), which need the implementation of
Mylib when you compile main.ml. Hence the difference.

Anyway, you have to specify even on ocamlopt command line the full
list of .cmx files you want to put in the result. So it's not a big
deal to have the list of .cmo/.cmx files in the dependencies.

-- Alain

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