diff --git a/sw/lib/ocaml/gen_common.ml b/sw/lib/ocaml/gen_common.ml index 008500ef41..9b45062d77 100644 --- a/sw/lib/ocaml/gen_common.ml +++ b/sw/lib/ocaml/gen_common.ml @@ -24,7 +24,7 @@ open Printf -type module_conf = { xml : Xml.xml; file : string; vpath : string option; param : Xml.xml list; extra_targets : string list; } +type module_conf = { xml : Xml.xml; file : string; filename : string; vpath : string option; param : Xml.xml list; extra_targets : string list; } let (//) = Filename.concat @@ -98,9 +98,10 @@ let rec get_modules_of_airframe = fun xml -> let dir = if Filename.is_relative dir then Env.paparazzi_home // dir else "" in (dir, Some dir) with _ -> (modules_dir, None) in - let file = dir // ExtXml.attrib m "name" in + let filename = ExtXml.attrib m "name" in + let file = dir // filename in let targets = singletonize (t @ targets_of_field m "") in - { xml = ExtXml.parse_file file; file = file; vpath = vpath; param = Xml.children m; extra_targets = targets } + { xml = ExtXml.parse_file file; file = file; filename = filename; vpath = vpath; param = Xml.children m; extra_targets = targets } in let modules_list = List.map (fun m -> if compare (Xml.tag m) "load" <> 0 then Xml2h.xml_error "load"; diff --git a/sw/lib/ocaml/gen_common.mli b/sw/lib/ocaml/gen_common.mli index 750adb046b..6b7d104786 100644 --- a/sw/lib/ocaml/gen_common.mli +++ b/sw/lib/ocaml/gen_common.mli @@ -24,12 +24,13 @@ (* Module configuration: * Xml node - * file name + * file (with path) + * file name only * optional vpath * parameters * extrat targets *) -type module_conf = { xml : Xml.xml; file : string; vpath : string option; param : Xml.xml list; extra_targets : string list; } +type module_conf = { xml : Xml.xml; file : string; filename : string; vpath : string option; param : Xml.xml list; extra_targets : string list; } (* Modules directory *) val modules_dir : string diff --git a/sw/tools/generators/gen_modules.ml b/sw/tools/generators/gen_modules.ml index 191ed29051..35589412e7 100644 --- a/sw/tools/generators/gen_modules.ml +++ b/sw/tools/generators/gen_modules.ml @@ -399,7 +399,7 @@ let () = (* Extract modules names (file name and module name) *) let modules_name = (List.map (fun m -> try Xml.attrib m.GC.xml "name" with _ -> "") modules) @ - (List.map (fun m -> m.GC.file) modules) in + (List.map (fun m -> m.GC.filename) modules) in (* Extract xml modules nodes *) let modules_list = List.map (fun m -> m.GC.xml) modules in check_dependencies modules_list modules_name;