open MatitaTypes
exception Drop;;
-exception UnableToInclude of string;;
+exception UnableToInclude of string
+exception IncludedFileNotCompiled of string
let debug = false ;;
let debug_print = if debug then prerr_endline else ignore ;;
in
try
aux paths
- with Unix.Unix_error _ as exc ->
- command_error ("File " ^ path ^ " not found")
+ with Unix.Unix_error _ as exc -> raise (UnableToInclude path)
;;
let eval_command opts status cmd =
let absolute_path = make_absolute opts.include_paths path in
let moopath = MatitaMisc.obj_file_of_script absolute_path in
let ic =
- try open_in moopath with Sys_error _ -> raise (UnableToInclude moopath) in
+ try open_in moopath with Sys_error _ ->
+ raise (IncludedFileNotCompiled moopath) in
let stream = Stream.of_channel ic in
let status = ref status in
!eval_from_stream_ref status stream (fun _ _ -> ());
exception Drop
exception UnableToInclude of string
+exception IncludedFileNotCompiled of string
type statement =
(CicNotationPt.term, GrafiteAst.obj, string) GrafiteAst.statement
try
eval_with_engine guistuff status user_goal parsed_text st
with
- MatitaEngine.UnableToInclude what as exc ->
+ | MatitaEngine.UnableToInclude what
+ | MatitaEngine.IncludedFileNotCompiled what as exc ->
let compile_needed_and_go_on d =
let target = what in
let refresh_cb () =
(* creates a new development if possible *)
let initialize_development name dir =
+ let name = Pcre.replace ~pat:" " ~templ:"_" name in
let dev = {name = name ; root = dir} in
match development_for_dir dir with
| Some d ->
let old = Unix.getcwd () in
try
Unix.chdir chdir;
- let rc = Unix.system (String.concat " " ("make"::args)) in
+ let rc =
+ Unix.system
+ (String.concat " " ("make"::(List.map Filename.quote args)))
+ in
Unix.chdir old;
match rc with
| Unix.WEXITED 0 -> true
($(MATITAC) -q -I @ROOT@ $< | (grep -v "^make" || true))
@DEPFILE@ : $(SRC)
- @DEP@ -I @ROOT@ $^ > @DEPFILE@
+ @DEP@ -I '@ROOT@' $^ > @DEPFILE@
# this is the depend for full targets like:
# dir/dir/name.moo: dir/dir/name.ma dir/dep.moo