caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Behavior of csldep
@ 1996-03-18 22:16 Kevin Gallo
  1996-03-20 10:06 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Gallo @ 1996-03-18 22:16 UTC (permalink / raw)
  To: 'caml-list@pauillac.inria.fr'


When I use csldep to automatically generate dependencies for both 
bytecode and native code versions, the .cmo files are listed as 
depending on .cmi files whereas the .cmx files are listed as depending 
on the .cmx files.  Is this the correct behavior and is there a 
workaround?

Thanks,

Kevin 





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Behavior of csldep
  1996-03-18 22:16 Behavior of csldep Kevin Gallo
@ 1996-03-20 10:06 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 1996-03-20 10:06 UTC (permalink / raw)
  To: Kevin Gallo; +Cc: caml-list


> When I use csldep to automatically generate dependencies for both 
> bytecode and native code versions, the .cmo files are listed as 
> depending on .cmi files whereas the .cmx files are listed as depending 
> on the .cmx files.  Is this the correct behavior and is there a 
> workaround?

I'll put this in the FAQ, because it seems to puzzle many users.

.cmx files depend also on .cmx files because these files contain
information for cross-module optimizations. If a compilation unit A
calls a function in unit B, generating code from A.ml looks up
information on the called function in B.cmx.

Hence, if B.cmx changes (e.g. if B.ml is recompiled), A.ml must also
be recompiled, which is obtained by saying that A.cmx depends on
B.cmx.

Not recompiling A may cause its code to become inconsistent with
that of B. This is detected at link-time and causes an error. So, it
would not be safe to remove the dependencies between .cmx files.

On the other hand, it often happens that recompiling a .ml file does
not actually change its .cmx file (if the changes to the .ml file are
small enough), in which case no further recompilation is
needed. Unfortunately, "make" is too dumb to understand that. I have
been unable to express this kind of dependencies in a standard
Makefile. A special-purpose compilation manager is needed to minimize
the amount of recompilation necessary.

- Xavier Leroy





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-03-20 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-18 22:16 Behavior of csldep Kevin Gallo
1996-03-20 10:06 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).