caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ian Zimmerman <itz@speakeasy.org>
To: caml-list@inria.fr (OCAML)
Subject: [Caml-list] -i option to compiler
Date: 09 Jan 2002 13:19:42 -0800	[thread overview]
Message-ID: <861ygzb4sx.fsf@speakeasy.org> (raw)


Hi, I remember using the -i option successfully in the past to
generate a fat interface to an existing .ml file.  However, after
upgrading to 3.04 and trying to recompile some of my stuff, I can't
seem to remember how to do without an excessive amount of pain.

I have a file foo.ml, and I want to generate foo.mli.

kronstadt:~$ cat >>foo.ml
let i = 1
kronstadt:~$ ocamlc -i foo.ml > foo.mli
I/O error: foo.cmi: No such file or directory
kronstadt:~$ ocamlc -i -c foo.ml > foo.mli
I/O error: foo.cmi: No such file or directory
kronstadt:~$ ocamlc -c foo.ml
I/O error: foo.cmi: No such file or directory
kronstadt:~$ rm foo.mli
kronstadt:~$ ocamlc -c foo.ml
kronstadt:~$ ls -l foo.cmo
-rw-rw-r--    1 itz      itz           145 Jan  9 13:14 foo.cmo
kronstadt:~$ ocamlc -i -c foo.ml > foo.mli
kronstadt:~$ ls -l foo.cmo
-rw-rw-r--    1 itz      itz           147 Jan  9 13:15 foo.cmo
kronstadt:~$ 

So, it seems that I have to first _compile_ foo.ml to get both foo.cmi
and foo.cmo, and then compile it _again_ with the -i flag to get
foo.mli.  Is that so?  Isn't there a way to generate _just_ foo.mli
and not the object file?

-- 
Ian Zimmerman, Oakland, California, U.S.A.
GPG: 433BA087  9C0F 194F 203A 63F7 B1B8  6E5A 8CA3 27DB 433B A087
In his own soul a man bears the source
from which he draws all his sorrows and his joys.
Sophocles.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


             reply	other threads:[~2002-01-09 21:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-09 21:19 Ian Zimmerman [this message]
2002-01-09 21:30 ` David Monniaux
2002-01-09 23:13   ` Eric C. Cooper
2002-01-09 23:24     ` Ian Zimmerman
2002-01-10  1:57       ` Jacques Garrigue

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=861ygzb4sx.fsf@speakeasy.org \
    --to=itz@speakeasy.org \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).