1 (* Copyright (C) 2004-2008, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 exception NoRootFor of string
28 (* make a relative path absolute *)
29 val absolutize: string -> string
31 (* a root file is a text, line oriented, file containing pairs separated by
32 * the '=' character. Example:
34 * baseuri = cic:/foo/bar
35 * include_paths = ../baz ../../pippo
37 * spaces at the end/begin of the line and around '=' are ignored,
38 * multiple spaces in the middle of an item are shrinked to one.
40 val load_root_file: string -> (string*string) list
42 (* baseuri_of_script ?(inc:REG[matita.includes]) fname
44 * root, buri, fullpath, rootrelativepath
45 * sample: baseuri_of_script a.ma -> /home/pippo/devel/, cic:/matita/a,
46 * /home/pippo/devel/a.ma, a.ma *)
47 val baseuri_of_script:
48 include_paths:string list -> string -> string * string * string * string
50 (* given a baseuri and a file name (relative to its root)
52 * mk_baseuri "cic:/matita" "nat/plus.ma" -> "cic:/matita/nat/plus"
54 val mk_baseuri: string -> string -> string
56 (* finds all the roots files in the specified dir, roots are
57 * text files, readable by the user named 'root'
59 val find_roots_in_dir: string -> string list
61 (* make implementation *)
62 type options = (string * string) list
68 val load_deps_file: string -> (source_object * source_object list) list
69 val string_of_source_object: source_object -> string
70 val string_of_target_object: target_object -> string
71 val build: options -> source_object -> bool
72 val root_and_target_of:
73 options -> source_object -> string option * target_object
74 val mtime_of_source_object: source_object -> float option
75 val mtime_of_target_object: target_object -> float option
76 val is_readonly_buri_of: options -> source_object -> bool
80 functor (F : Format) ->
82 (* make [root dir] [targets], targets = [] means make all *)
83 val make : string -> F.source_object list -> bool
86 (* deps are made with scripts names, for example lines like
88 * nat/plus.ma nat/nat.ma logic/equality.ma
90 * state that plus.ma needs nat and equality
92 val load_deps_file: string -> (string * string list) list
93 val write_deps_file: string option -> (string * string list) list -> unit
95 (* FG ***********************************************************************)
97 (* true if the argunent starts with a uri scheme prefix *)
98 val is_uri: string -> bool