]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitamakeLib.ml
ocaml 3.09 transition
[helm.git] / helm / matita / matitamakeLib.ml
index 6e0d5660cd62148b2cade6a99410495da25fad48..998dcd70edf225f595509a23ff822d715f63fb98 100644 (file)
@@ -55,7 +55,7 @@ let ls_dir dir =
 
 let initialize () = 
   (* create a base env if none *)
-  MatitaMisc.mkdir (pool ());
+  HExtlib.mkdir (pool ());
   (* load developments *)
   match ls_dir (pool ()) with
   | None -> logger `Error ("Unable to list directory " ^ pool ()) 
@@ -64,7 +64,7 @@ let initialize () =
         (fun name -> 
           let root = 
             try 
-              Some (MatitaMisc.input_file (pool () ^ name ^ rootfile))
+              Some (HExtlib.input_file (pool () ^ name ^ rootfile))
             with Unix.Unix_error _ -> 
               logger `Warning ("Malformed development " ^ name);
               None
@@ -106,8 +106,8 @@ let development_for_name name =
 (* dumps the deveopment to disk *)
 let dump_development devel =
   let devel_dir = pool () ^ devel.name in 
-  MatitaMisc.mkdir devel_dir;
-  MatitaMisc.output_file devel.root (devel_dir ^ rootfile);
+  HExtlib.mkdir devel_dir;
+  HExtlib.output_file ~filename:(devel_dir ^ rootfile) ~text:devel.root
 ;;
 
 let list_known_developments () = 
@@ -119,7 +119,7 @@ let am_i_opt () =
 let rebuild_makefile development = 
   let makefilepath = makefile_for_development development in
   let template = 
-    MatitaMisc.input_file BuildTimeConf.matitamake_makefile_template 
+    HExtlib.input_file BuildTimeConf.matitamake_makefile_template 
   in
   let cc = BuildTimeConf.runtime_base_dir ^ "/matitac" ^ am_i_opt () in
   let rm = BuildTimeConf.runtime_base_dir ^ "/matitaclean" ^ am_i_opt () in
@@ -130,7 +130,7 @@ let rebuild_makefile development =
   let template = Pcre.replace ~pat:"@DEP@" ~templ:mm template in
   let template = Pcre.replace ~pat:"@DEPFILE@" ~templ:df template in
   let template = Pcre.replace ~pat:"@CLEAN@" ~templ:rm template in
-  MatitaMisc.output_file template makefilepath
+  HExtlib.output_file ~filename:makefilepath ~text:template
   
 (* creates a new development if possible *)
 let initialize_development name dir =
@@ -171,8 +171,13 @@ let make chdir args =
 let call_make development target make =
   rebuild_makefile development;
   let makefile = makefile_for_development development in
+  let nodb =
+    Helm_registry.get_opt_default Helm_registry.bool ~default:false "db.nodb"
+  in
+  let flags = if nodb then ["NODB=true"] else [] in
   make development.root 
-    ["--no-print-directory"; "-s"; "-k"; "-f"; makefile; target]
+    (["--no-print-directory"; "-s"; "-k"; "-f"; makefile; target]
+    @ flags)
       
 let build_development ?(target="all") development =
   call_make development target make