caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamldep  problem with .cmo vs .cmx
@ 2002-08-07  0:06 Henri Dubois-Ferriere
  2002-08-07 10:41 ` Alain Frisch
  0 siblings, 1 reply; 2+ messages in thread
From: Henri Dubois-Ferriere @ 2002-08-07  0:06 UTC (permalink / raw)
  To: caml-list

Hi,

I have noticed that ocamldep fills in dependencies differently for a .cmo
than for a .cmx

Say my file main.ml does a "open mylib"

then ocamldep will produce the following dependencies:

main.cmo: mylib.cmi
(depends on *interface* of included module)
main.cmx: mylib.cmx
(depends on compiled *object code* of included module)

mylib.cmo: mylib.cmi
mylib.cmx: mylib.cmi

So, in the cmx case, we have the full dependency file so that a makefile
target like

main_opt: main.cmx
	$(OCAMLOPT) $(OBJ_FILES) ... ..

will follow all the dependencies and compile mylib.cmi and mylib.cmx
(assuming the right implicit rules etc).

whereas if we have a target for the bytecode version like:

main_bcode: main.cmo
	$(OCAMLC) $(BC_OBJ_FILES) ... ..

make will only compile mylib.cmi and not mylib.cmo, so one would have to
explicitly add mylib.cmo as a dependency of main_bcode. This is painful in
itself, on top of forcing bytecode and native rules to be different.

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

? This would make .cmx and .cmo treatment consistent, as well as simplify
makefile writing.

thanks
henri

-------------------
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


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

end of thread, other threads:[~2002-08-07 10:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-07  0:06 [Caml-list] ocamldep problem with .cmo vs .cmx Henri Dubois-Ferriere
2002-08-07 10:41 ` Alain Frisch

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).