Commit f80498e1 authored by Bernhard Schommer's avatar Bernhard Schommer Committed by Xavier Leroy
Browse files

Extend the modorder tool to handle Coq files as well (#54)

This is useful to e.g. identify the .vo files from CompCert that a clightgen-generated .v file needs.

Also: the "result" field of the record type is now initialized with the LHS of the dependency, not the RHS.  It doesn't matter because the result field is unused, but it makes more sense now.
parent f02f00a0
......@@ -29,7 +29,7 @@ type node = {
let re_continuation_line = Str.regexp "\\(.*\\)\\\\[ \t]*$"
let re_depend_line = Str.regexp "\\([^ ]+\\) *:\\(.*\\)$"
let re_depend_line = Str.regexp "\\([^:]*\\):\\(.*\\)$"
let re_whitespace = Str.regexp "[ \t\n]+"
......@@ -51,12 +51,14 @@ let parse_dependencies depfile =
end else begin
let lhs = Str.matched_group 1 l
and rhs = Str.matched_group 2 l in
let node = {
deps = Str.split re_whitespace rhs;
result = rhs;
status = Todo
} in
Hashtbl.add deps lhs node
let lhs = Str.split re_whitespace lhs
and rhs = Str.split re_whitespace rhs in
List.iter (fun lhs -> let node = {
deps = rhs;
result = lhs;
status = Todo
} in
Hashtbl.add deps lhs node) lhs
end in
begin try
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment