caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Hezekiah M. Carty" <hcarty@atmos.umd.edu>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: OCaml List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] ocamlbuild rules generating multiple files
Date: Tue, 10 Feb 2009 17:33:04 -0500	[thread overview]
Message-ID: <3a360f590902101433t1f955f6cw908c77bedb053d80@mail.gmail.com> (raw)
In-Reply-To: <D7E06A96-39D7-429E-89A1-E3A4A7AC20F5@erratique.ch>

On Tue, Feb 10, 2009 at 5:15 PM, Daniel Bünzli
<daniel.buenzli@erratique.ch> wrote:
> If in a rule a command generates multiple files (which don't necessary have
> the same basename as the dep), how can I make ocamlbuild understand that
> these files now exist in _build ?

I've used the following rule under After_rules in myocamlbuild.ml for
camlidl .idl files:

      (* Handle *.idl files properly... I think *)
      rule "camlidl processing"
        ~prods:["%.mli"; "%.ml"; "%_stubs.c"]
        ~deps:["%.idl"]
        begin fun env _build ->
          let idl = env "%.idl" in
          let tags = tags_of_pathname idl++"compile"++"camlidl" in
          let cmd = Cmd(S[camlidl; T tags; P idl]) in
          Seq [cmd]
        end;

Then, given foo.idl, "ocamlbuild foo.cma" seems to work properly,
finding the relevant camlidl-output files.

Hope this helps.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science


  reply	other threads:[~2009-02-10 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 22:15 Daniel Bünzli
2009-02-10 22:33 ` Hezekiah M. Carty [this message]
2009-02-10 22:39   ` [Caml-list] " Daniel Bünzli
2009-02-10 22:51     ` Hezekiah M. Carty
2009-02-10 22:59     ` Mikkel Fahnøe Jørgensen
2009-02-11 11:48 ` Romain Bardou

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=3a360f590902101433t1f955f6cw908c77bedb053d80@mail.gmail.com \
    --to=hcarty@atmos.umd.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=daniel.buenzli@erratique.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;
as well as URLs for NNTP newsgroup(s).