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=1.4 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id AA9D6BC6B for ; Thu, 10 Jan 2008 17:25:53 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAO7VhUfRVYa9kmdsb2JhbACCOTWNMQEBAQEHBAQJChaSfoYk X-IronPort-AV: E=Sophos;i="4.24,267,1196636400"; d="scan'208";a="21100306" Received: from mu-out-0910.google.com ([209.85.134.189]) by mail4-smtp-sop.national.inria.fr with ESMTP; 10 Jan 2008 17:25:53 +0100 Received: by mu-out-0910.google.com with SMTP id w8so391863mue.4 for ; Thu, 10 Jan 2008 08:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=rsuUmhct1TTKYthUR1NlhZZEbCMu3rXX3i/bqKwfBQI=; b=oeYQWH8lnbHr3Af0o9FBC+SrFE5irn6yf+euMfIXEd2Tk+grj1Yc8Ip36ZfSJgajFDhCMIUjtlbw8pzXFxF2ylEbMQWabCVjiNUArkqGfMIXRWRBX131hDEv0KVfDw8urb4qqPiaV6N3MLaPWha4/+3xp8lEMkSc/5pqjTAAGLc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=gYWq8TV3p057emBLJG1fmpXB4HW3iX6FYSVfraXzM1NyVhKxZegT3DAcTmewEIDauc8W5js0I+B0G/SllajVCO+c+O9aiIrxjU+DGMQrAtWjVUaK23YYtpM2BOVh3yKIWt7DIDe6tWVzAnpygFeXAtoHhh+DRnWKF0zpVbpmtMs= Received: by 10.78.83.15 with SMTP id g15mr2516310hub.6.1199982351829; Thu, 10 Jan 2008 08:25:51 -0800 (PST) Received: by 10.78.180.12 with HTTP; Thu, 10 Jan 2008 08:25:51 -0800 (PST) Message-ID: Date: Thu, 10 Jan 2008 11:25:51 -0500 From: "Ashish Agarwal" To: "Caml Mailing List" Subject: Re: [Caml-list] simple example of using ocamlbuild with C In-Reply-To: <9f09a07a0801100005n5061a656ubbf7620e48e298ee@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11281_29833765.1199982351822" References: <9f09a07a0801100005n5061a656ubbf7620e48e298ee@mail.gmail.com> X-Spam: no; 0.00; matthieu:01 dubuget:01 matthieu:01 dubuget:01 ocaml:01 byte:01 -custom:01 ocaml:01 endline:01 byte:01 stdio:01 stdlib:01 mlvalues:01 mlvalues:01 alloc:01 ------=_Part_11281_29833765.1199982351822 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks! On Jan 10, 2008 3:05 AM, Matthieu Dubuget wrote: > ---- myocamlbuild.ml ------ > > open Ocamlopen Ocamlbuild_plugin > open Command > ;; > dispatch begin function > | After_rules -> > flag ["link"; "ocaml"; "byte"] (A"-custom"); > dep ["link"; "ocaml"; "use_my_math"] ["avg.o"]; > | _ -> () > end > > ---- _tags ----- (do not forget the endline before end of file) > : use_my_math > > ++++++++++++++++ > > Works for me. > > Salutations > > P.S. > > I had to modify the beginning of > > > ---- avg.c --- > #include > #include > #include > #include > > into > > ---- avg.c --- > > #include > #include > #include > ------=_Part_11281_29833765.1199982351822 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks!


On Jan 10, 2008 3:05 AM, Matthieu Dubuget <matthieu.dubuget@gmail.com> wrote:
> ---- myocamlbuild.ml ------
>
> open Ocamlopen Ocamlbuild_plugin
> open Command
> ;;
> dispatch begin function
> | After_rules ->
> flag ["link"; "ocaml"; "byte"] (A"-custom");
> dep ["link"; "ocaml"; "use_my_math"] ["avg.o"];
> | _ -> ()
> end
>
> ---- _tags ----- (do not forget the endline before end of file)
> <run.{native,byte}>: use_my_math
>
> ++++++++++++++++
>
> Works for me.
>
> Salutations
>
> P.S.
>
> I had to modify the beginning of
>
>
> ---- avg.c ---
> #include < stdio.h >
> #include <stdlib.h>
> #include <caml/mlvalues.h>
> #include <caml/memory.h>
>
> into
>
> ---- avg.c ---
>
> #include <caml/mlvalues.h>
> #include <caml/memory.h>
> #include <caml/alloc.h>
>

------=_Part_11281_29833765.1199982351822--