From: Henri Dubois-Ferriere <henridf@lcavsun1.epfl.ch>
To: <caml-list@inria.fr>
Subject: [Caml-list] ocamldep problem with .cmo vs .cmx
Date: Wed, 7 Aug 2002 02:06:15 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.33.0208070141570.7524-100000@lcavpc19.epfl.ch> (raw)
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
next reply other threads:[~2002-08-07 0:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-07 0:06 Henri Dubois-Ferriere [this message]
2002-08-07 10:41 ` Alain Frisch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.33.0208070141570.7524-100000@lcavpc19.epfl.ch \
--to=henridf@lcavsun1.epfl.ch \
--cc=caml-list@inria.fr \
--cc=henri.dubois-ferriere@epfl.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox