module F = struct type source_object = string type target_object = string let string_of_source_object s = s let string_of_target_object s = s let target_of s = s ^ ".o" let build t = print_string ("build "^t^"\n"); flush stdout; ignore(Unix.system ("touch "^target_of t)) ;; let mtime_of_source_object s = try Some (Unix.stat s).Unix.st_mtime with Unix.Unix_error (Unix.ENOENT, "stat", f) when f = s -> prerr_endline ("Source file not found: "^s);assert false ;; let mtime_of_target_object t = try Some (Unix.stat t).Unix.st_mtime with Unix.Unix_error (Unix.ENOENT, "stat", f) when f = t -> None ;; end module M = Make.Make(F) let deps = [ "a.c", [ "b.c"; "d.c" ]; "b.c", [ "c.c"; "d.c" ]; "c.c", []; "d.c", ["e.c"]; "e.c", []; ] ;; M.make deps;;