(* here we go *)
   if not (Helm_registry.get_bool "matita.verbose") then MatitaMisc.shutup ();
   if MatitacLib.Make.make root target then 
-    HLog.message "Compilation successful"
+    (HLog.message "Compilation successful"; 0)
   else
-    HLog.message "Compilation failed"
+    (HLog.message "Compilation failed"; 1)
 ;;
 
 let main () =
   if      Pcre.pmatch ~pat:"^matitadep"    bin then Matitadep.main ()
   else if Pcre.pmatch ~pat:"^matitaclean"  bin then Matitaclean.main ()
   else if Pcre.pmatch ~pat:"^matitawiki"   bin then MatitaWiki.main ()
-  else main_compiler ()
+  else exit (main_compiler ())
 ;;
 
 let _ = main ()