1 Q: I've a directory with examples and I want build all of them easily?
5 You can use an .itarget file listing all products that you want.
11 $ ocamlbuild examples.otarget
13 You can also have a dynamic rule that read the examples directory:
16 open Ocamlbuild_plugin;;
18 dispatch begin function
21 Array.fold_right begin fun f acc ->
22 if Pathname.get_extension f = "ml" then
23 ("examples" / Pathname.update_extension "byte" f) :: acc
26 end (Pathname.readdir "examples") []
29 ~prod:"examples.otarget"
31 (fun _ _ -> Command.Nop)
35 $ ocamlbuild examples.otarget