From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id B7C82BB84 for ; Mon, 16 Jun 2008 13:00:46 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AssAAMzkVUiGnQCBhmdsb2JhbACSHQEBAQoFBgcRmkY X-IronPort-AV: E=Sophos;i="4.27,652,1204498800"; d="scan'208";a="14055171" Received: from shiva.jussieu.fr ([134.157.0.129]) by mail3-smtp-sop.national.inria.fr with ESMTP; 16 Jun 2008 13:00:46 +0200 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id m5GB0jW3021768 ; Mon, 16 Jun 2008 13:00:45 +0200 (CEST) X-Ids:165 Received: from [134.157.168.28] (nickel.pps.jussieu.fr [134.157.168.28]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id m5GB0hMw006827 ; Mon, 16 Jun 2008 13:00:44 +0200 Message-ID: <485647DB.3020107@glondu.net> Date: Mon, 16 Jun 2008 13:00:43 +0200 From: =?ISO-8859-1?Q?St=E9phane_Glondu?= User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) MIME-Version: 1.0 To: Renald Buter Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ocamlbuild: simplification of invocation References: <48562D5F.80407@cwts.leidenuniv.nl> In-Reply-To: <48562D5F.80407@cwts.leidenuniv.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (shiva.jussieu.fr [134.157.0.165]); Mon, 16 Jun 2008 13:00:45 +0200 (CEST) X-Virus-Scanned: ClamAV 0.93.1/7488/Mon Jun 16 08:06:58 2008 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail2.jussieu.fr with ID 48562BBF.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 48562BBF.000/134.157.168.1/hydrogene.pps.jussieu.fr/hydrogene.pps.jussieu.fr/ X-j-chkmail-Score: MSGID : 48562BBF.000 on jchkmail2.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.069 -> S=0.069 X-j-chkmail-Status: Ham X-Spam: no; 0.00; invocation:01 ocaml:01 cflags:01 ocaml:01 libs:01 cheers:01 steph:98 invoke:01 unix:01 unix:01 caml-list:01 native:03 native:03 dispatch:03 root:04 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, -- Stéphane Glondu