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.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 931E3BBC1 for ; Mon, 3 Mar 2008 13:25:05 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.25,438,1199660400"; d="asc'?scan'208";a="8890654" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail1-relais-roc.national.inria.fr with SMTP; 03 Mar 2008 13:25:05 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Mon, _d Mar 2008 13:23:56 +0100 From: "Nicolas Pouillard" Cc: Paolo Donadeo , caml-list caml-list Subject: Re: [Caml-list] How to tell ocamlbuild to pass options to ocamldoc? To: Romain Bardou References: <47C9A4BA.7040504@fmf.uni-lj.si> <4b5157c30803020226i2f84248eh5535985c753f58a@mail.gmail.com> <47CBB144.8020108@lri.fr> In-Reply-To: <47CBB144.8020108@lri.fr> Date: Mon, 03 Mar 2008 13:23:51 +0100 Message-Id: <1204547029-sup-3853@ausone.inria.fr> User-Agent: Sup/git Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1204547036-712121-2553-2504-1-="; micalg="pgp-sha1" MIME-Version: 1.0 X-Spam: no; 0.00; ocamldoc:01 -keep-code:01 ocaml:01 interf:01 ocaml:01 -keep-code:01 foo:01 cheers:01 ocamldoc:01 ocamlfind:01 netcgi:01 netcgi:01 netstring:01 pxp-engine:01 ocamlfind:01 X-Attachments: cset="UTF-8" type="application/pgp-signature" name="signature.asc" name="signature.asc" --=-1204547036-712121-2553-2504-1-= Content-Type: text/plain; charset=UTF-8 Excerpts from Romain Bardou's message of Mon Mar 03 09:05:24 +0100 2008: > I didn't find any tag for the -keep-code flag. So indeed, I guess you > need a plugin. I would suggest adding the flag for tags "ocaml" and > "doc" (other useful tags are: interf, implem, extension:html, > extension:tex and so on, docfile, docdir). > > Something like this: > > open Ocamlbuild_plugin;; > > dispatch begin function > | After_rules -> > flag ["ocaml"; "doc"] "-keep-code" > end Thanks Romain, You can also be less global by adding a new tag "keep_code": ============== open Ocamlbuild_plugin;; dispatch begin function | After_rules -> flag ["ocaml"; "doc"; "keep_code"] "-keep-code" end ============== And then in your _tags : keep_code Cheers, > Paolo Donadeo a écrit : > >> Perhaps I am just blind, but I was unable to figure out after poking > >> around for a while, how to tell ocamlbuild that it should pass the > >> -keep-code flag to ocamldoc. I suspect I need to put something in _tags, > >> but what? (I am an ocamlbuild newbie.) > > > > I don't know if this is the best way, but I use the myocamlbuild > > module to pass arguments to ocamlfind and ocamldoc, it just works. > > > > An example: > > > > =============== myocamlbuild.ml =============== > > open Ocamlbuild_plugin;; > > open Command;; > > > > let (|>) x f = f x > > > > let packages = > > [ > > "cryptokit"; > > "extlib"; > > "netcgi2"; > > "netcgi2-plex"; > > "nethttpd"; > > "netplex"; > > "netstring"; > > "oUnit"; > > "pxp-engine"; > > "pxp-lex-iso88591"; > > "str"; > > "unix" > > ] |> String.concat ",";; > > > > let ocamlfind cmd = S[A"ocamlfind"; A cmd; A"-package"; A packages];; > > > > flag ["ocaml"; "link"] (A"-linkpkg");; > > > > let ocamldoc = > > S[A"ocamlfind"; > > A"ocamldoc"; > > A"-package"; > > A packages; > > A"-stars"; > > A"-colorize-code"; > > A"-intro"; A"../documentation/doc_index.txt"; > > A"-css-style"; A"../documentation/style.css"; > > A"-t"; A"The Ex-nunc System"; > > ];; > > > > dispatch begin function > > | After_options -> > > Options.ocamldoc := ocamldoc; > > Options.ocamlc := ocamlfind "ocamlc"; > > Options.ocamlopt := ocamlfind "ocamlopt"; > > | _ -> () > > end > > =========== END OF myocamlbuild.ml ============ > > > > > > > -- Nicolas Pouillard aka Ertai --=-1204547036-712121-2553-2504-1-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkfL7dcACgkQj+FCNw9dwLmRHgCfe61kBxWMGZlKkqTe8KjPqd7S VfkAoIDNhZN4YCntuYBzkDb6wRnrGXQY =qWo5 -----END PGP SIGNATURE----- --=-1204547036-712121-2553-2504-1-=--