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 9B395BB84 for ; Mon, 16 Jun 2008 13:48:05 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAFjvVUiE5UFf/2dsb2JhbACtGg X-IronPort-AV: E=Sophos;i="4.27,652,1204498800"; d="scan'208";a="14056966" Received: from fswmim01.dmz.fsw.leidenuniv.nl ([132.229.65.95]) by mail3-smtp-sop.national.inria.fr with ESMTP; 16 Jun 2008 13:48:05 +0200 Received: from studies.cwts.nl (unverified [132.229.67.201]) by FSWMIM01.dmz.fsw.leidenuniv.nl (Clearswift SMTPRS 5.2.9) with ESMTP id ; Mon, 16 Jun 2008 13:48:04 +0200 Received: from [132.229.67.31] (infinite.fsw.leidenuniv.nl [132.229.67.31]) by studies.cwts.nl (Postfix) with ESMTP id 5D01D48259AF; Mon, 16 Jun 2008 13:48:04 +0200 (CEST) Message-ID: <485652F4.7070406@cwts.leidenuniv.nl> Date: Mon, 16 Jun 2008 13:48:04 +0200 From: Renald Buter Organization: CWTS User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: Ocaml Mailinglist Cc: steph@glondu.net Subject: Re: [Caml-list] ocamlbuild: simplification of invocation References: <48562D5F.80407@cwts.leidenuniv.nl> <485647DB.3020107@glondu.net> In-Reply-To: <485647DB.3020107@glondu.net> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; invocation:01 ocaml:01 cflags:01 ocaml:01 libs:01 cheers:01 invoke:01 wrote:01 unix:01 unix:01 caml-list:01 native:03 native:03 dispatch:03 root:04 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. **********************************************************************