~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to ocamlbuild/ocaml_tools.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2009-02-22 08:49:13 UTC
  • mfrom: (12.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222084913-3i0uw2bhd0lgw0ok
* Uploading to unstable
* debian/control: bump dh-ocaml to (>= 0.4) to avoid buggy ocamlinit.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
(*                                                                     *)
10
10
(***********************************************************************)
11
11
 
12
 
(* $Id: ocaml_tools.ml,v 1.2.4.9 2007/11/22 18:49:38 ertai Exp $ *)
 
12
(* $Id: ocaml_tools.ml,v 1.12 2008/07/25 15:06:47 ertai Exp $ *)
13
13
(* Original author: Nicolas Pouillard *)
14
14
open My_std
15
15
open Pathname.Operators
71
71
  let (tags,files) = import_mlypack build mlypack in
72
72
  let () = List.iter Outcome.ignore_good (build [[mlypack_depends]]) in
73
73
  Ocaml_compiler.prepare_compile build mlypack;
 
74
  let ocamlc_tags = tags++"ocaml"++"byte"++"compile" in
74
75
  let tags = tags++"ocaml"++"parser"++"menhir" in
75
76
  Cmd(S[menhir ;
76
 
        A "--ocamlc"; Quote(S[!Options.ocamlc; ocaml_include_flags mlypack]);
 
77
        A "--ocamlc"; Quote(S[!Options.ocamlc; T ocamlc_tags; ocaml_include_flags mlypack]);
77
78
        T tags ; A "--infer" ; flags_of_pathname mlypack ;
78
79
        A "--base" ; Px menhir_base ; atomize_paths files])
79
80
 
151
152
  let module_paths = List.map Outcome.good (build to_build) in
152
153
  let tags = (Tags.union (tags_of_pathname docout) (tags_of_pathname docdir))++"ocaml" in
153
154
  ocamldoc tags module_paths docout docdir
 
155
 
 
156
let camlp4 ?(default=A"camlp4o") tag i o env build =
 
157
  let ml = env i and pp_ml = env o in
 
158
  let tags = tags_of_pathname ml++"ocaml"++"pp"++tag in
 
159
  let _ = Rule.build_deps_of_tags build tags in
 
160
  let pp = Command.reduce (Flags.of_tags tags) in
 
161
  let pp =
 
162
    match pp with
 
163
    | N -> default
 
164
    | _ -> pp
 
165
  in
 
166
  Cmd(S[pp; P ml; A"-printer"; A"o"; A"-o"; Px pp_ml])