caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Renald Buter <buter@cwts.leidenuniv.nl>
To: Ocaml Mailinglist <caml-list@yquem.inria.fr>
Cc: steph@glondu.net
Subject: Re: [Caml-list] ocamlbuild: simplification of invocation
Date: Mon, 16 Jun 2008 13:48:04 +0200	[thread overview]
Message-ID: <485652F4.7070406@cwts.leidenuniv.nl> (raw)
In-Reply-To: <485647DB.3020107@glondu.net>

Stéphane Glondu wrote:
> Renald Buter a écrit :
>> [...]
>> To build this, I have to enter:
>>
>>   ocamlbuild -cflags -I,+oUnit -lflags -I,+oUnit -libs unix,oUnit 
>> test_setup.native
>>
>> Now, is there any way of simplifying this? I've tried looking into the 
>> tags for the _tags file, but got confused...
> 
> You can make a plugin which sets these options by putting the following 
> lines in a file named myocamlbuild.ml at the root of your project:
> 
> --8<----------
> open Ocamlbuild_plugin;;
> 
> dispatch begin function
>   | Before_options ->
>       Options.ocaml_cflags := [ "-I"; "+oUnit"];
>       Options.ocaml_lflags := [ "-I"; "+oUnit"];
>       Options.ocaml_libs := [ "unix"; "oUnit"];
>   | _ -> ()
> end;;
> --8<----------
> 
> Then you can just invoke "ocamlbuild test_setup.native".
> 
> 
> Cheers,
> 

Ah! That looks simple... Thank you.

Could this be made file-specific (I will not have to use oUnit in the 
final result)? Probably some combination of myocamlbuild.ml and _tags? 
Or are multiple targets a problem for ocamlbuild?

With kind regards,

Renald Buter

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


  reply	other threads:[~2008-06-16 11:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16  9:07 Renald Buter
2008-06-16 11:00 ` [Caml-list] " Stéphane Glondu
2008-06-16 11:48   ` Renald Buter [this message]
2008-06-16 12:02     ` Stéphane Glondu

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=485652F4.7070406@cwts.leidenuniv.nl \
    --to=buter@cwts.leidenuniv.nl \
    --cc=caml-list@yquem.inria.fr \
    --cc=steph@glondu.net \
    /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).