English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
How to tell ocamlbuild to pass options to ocamldoc?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-02 (10:26)
From: Paolo Donadeo <p.donadeo@g...>
Subject: Re: [Caml-list] How to tell ocamlbuild to pass options to ocamldoc?
> 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 =
  ] |> String.concat ",";;

let ocamlfind cmd = S[A"ocamlfind"; A cmd; A"-package"; A packages];;

flag ["ocaml"; "link"] (A"-linkpkg");;

let ocamldoc =
    A packages;
    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 OF myocamlbuild.ml ============

Paolo Donadeo
Studio Associato 4Sigma
Website:  http://www.4sigma.it
Email:    p.donadeo@4sigma.it