- List.iter
- (function
- | DependenciesParser.UriDep uri ->
- let uri = UriManager.string_of_uri uri in
- if not (Http_getter_storage.is_legacy uri) then
- Hashtbl.add uri_deps ma_file uri
- | DependenciesParser.BaseuriDep uri ->
- let uri = Http_getter_misc.strip_trailing_slash uri in
- Hashtbl.add baseuri_of ma_file uri;
- Hashtbl.add baseuri_of_inv uri ma_file
- | DependenciesParser.IncludeDep path ->
- try
- let baseuri = baseuri_of_script path in
- if not (Http_getter_storage.is_legacy baseuri) then
- (let moo_file = obj_file_of_baseuri false baseuri in
- Hashtbl.add include_deps ma_file moo_file;
- Hashtbl.add include_deps_dot ma_file baseuri)
- with Sys_error _ ->
- HLog.warn
- ("Unable to find " ^ path ^ " that is included in " ^ ma_file))
- dependencies)
+ if !order_only then begin
+ let relative_ma_file =
+ (* change a path leading to a .ma file into a path relative to its
+ * development root dir *)
+ let absolute_ma_file =
+ if Filename.is_relative ma_file then
+ Filename.concat (Sys.getcwd ()) ma_file
+ else
+ ma_file in
+ let ma_dir = Filename.dirname absolute_ma_file in
+ match MatitamakeLib.development_for_dir ma_dir with
+ | None ->
+ eprintf "no development setup for dir '%s'\n%!" ma_dir;
+ assert false
+ | Some devel ->
+ Pcre.replace
+ ~pat:(Pcre.quote(MatitamakeLib.root_for_development devel) ^ "/?")
+ ~templ:"" absolute_ma_file
+ in
+ ma_topo_keys := relative_ma_file :: !ma_topo_keys;
+ List.iter
+ (function
+ | DependenciesParser.IncludeDep path ->
+ Hashtbl.add ma_topo relative_ma_file path
+ | _ -> ())
+ dependencies
+ end else
+ List.iter
+ (function
+ | DependenciesParser.UriDep uri ->
+ let uri = UriManager.string_of_uri uri in
+ if not (Http_getter_storage.is_legacy uri) then
+ Hashtbl.add uri_deps ma_file uri
+ | DependenciesParser.BaseuriDep uri ->
+ let uri = Http_getter_misc.strip_trailing_slash uri in
+ Hashtbl.add baseuri_of ma_file uri;
+ Hashtbl.add baseuri_of_inv uri ma_file
+ | DependenciesParser.IncludeDep path ->
+ try
+ let baseuri = baseuri_of_script path in
+ if not (Http_getter_storage.is_legacy baseuri) then
+ (let moo_file = obj_file_of_baseuri false baseuri in
+ Hashtbl.add include_deps ma_file moo_file;
+ Hashtbl.add include_deps_dot ma_file baseuri)
+ with Sys_error _ ->
+ HLog.warn
+ ("Unable to find " ^ path ^ " that is included in " ^ ma_file))
+ dependencies)