caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlbuild is VERY nifty
@ 2007-03-07 15:53 Joel Reymont
  2007-03-07 20:55 ` [Caml-list] beta-test of OCaml 3.10.0 Jon Harrop
  2007-03-13 18:38 ` [Caml-list] ocamlbuild is VERY nifty Aleksey Nogin
  0 siblings, 2 replies; 5+ messages in thread
From: Joel Reymont @ 2007-03-07 15:53 UTC (permalink / raw)
  To: Caml List

I asked around before settling on a build system since I'm new to  
OCaml. I looked at OMake, OCamlMakefile and found them complex and  
confusing. Then William Neuman pointed me to ocamlbuild and Nicolas  
Pouillard helped me hook it up to external libraries via a plugin.

Deep into my first project I confirm that ocamlbuild is VERY nifty. I  
can automatically rebuild when any parts of my project change and  
then run my unit tests.

All I need to do is:

ocamlbuild test.byte --

*** my project ***

      189 easy.mli
      282 easy_lexer.mll
      420 easy_parser.mly
       17 myocamlbuild.ml
       14 parser_util.ml
       30 symtab.ml
        8 test.ml
      284 parser_test.ml
     1355 total

*** test.ml ***

open OUnit

let suite = "Morpher" >:::
   [Parser_test.suite]

let _ =
   run_test_tt_main suite

*** myocamlbuild.ml ***

open Ocamlbuild_plugin;;
open Command;;

let packages = "ounit" (* "pkg1,pkg2,..." *);;

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

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

dispatch begin function
| After_options ->
      Options.ocamlc := ocamlfind "ocamlc";
      Options.ocamlopt := ocamlfind "ocamlopt";
| _ -> ()
end

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-16 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-07 15:53 ocamlbuild is VERY nifty Joel Reymont
2007-03-07 20:55 ` [Caml-list] beta-test of OCaml 3.10.0 Jon Harrop
2007-03-13 18:38 ` [Caml-list] ocamlbuild is VERY nifty Aleksey Nogin
2007-03-16 13:46   ` Joel Reymont
2007-03-16 17:01     ` Aleksey Nogin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).