1 open Ocamlbuild_plugin ;;
3 let includes = [ "include/utils.ml"; "include/utils32.ml"; "include/utils64.ml"; "include/debug.ml" ]
6 rule ".ml.str" ~dep:"%.ml.str" ~prod:"%.ml"
8 let mlstr = env "%.ml.str" and ml = env "%.ml" in
9 let cmd = Printf.sprintf "echo -n 'let content = \"' > %s ;\
10 sed -e 's/\\([\"\\\\]\\)/\\\\\\1/g' %s | sed -e 's/^\\(.*\\)$/\\1\\\\n\\\\/g' >> %s ;\
12 echo '\"' >> %s" ml mlstr ml ml ml
17 dispatch begin function
19 dep ["ocaml";"compile";] includes;
20 dep ["ocaml";"ocamldep"; ] includes;
21 pflag ["ocaml";"compile";] "ppopt" (fun s -> S [A"-ppopt"; A (s)]);
22 pflag ["ocaml";"ocamldep";] "ppopt" (fun s -> S [A"-ppopt"; A (s)]);