aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/coqProject_file.mli
blob: 5780bb5d78630de903b7cd47252cc22a60d90e20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)

exception Parsing_error of string

type arg_source = CmdLine | ProjectFile

type 'a sourced = { thing : 'a; source : arg_source }

type project = {
  project_file  : string option;
  makefile : string option;
  install_kind  : install option;
  use_ocamlopt : bool;

  v_files : string sourced list;
  mli_files : string sourced list;
  ml4_files : string sourced list;
  ml_files : string sourced list;
  mllib_files : string sourced list;
  mlpack_files : string sourced list;

  ml_includes : path sourced list;
  r_includes  : (path * logic_path) sourced list;
  q_includes  : (path * logic_path) sourced list;
  extra_args : string sourced list;
  defs : (string * string) sourced list;

  (* deprecated in favor of a Makefile.local using :: rules *)
  extra_targets : extra_target sourced list;
  subdirs : string sourced list;
}
and extra_target = {
  target : string;
  dependencies : string;
  phony : bool;
  command : string;
}
and logic_path = string
and path = { path : string; canonical_path : string }
and install =
  | NoInstall
  | TraditionalInstall
  | UserInstall

val cmdline_args_to_project : curdir:string -> string list -> project
val read_project_file : string -> project
val coqtop_args_from_project : project -> string list
val find_project_file : from:string -> projfile_name:string -> string option

val all_files : project -> string sourced list

val map_sourced_list : ('a -> 'b) -> 'a sourced list -> 'b list

(** Only uses the elements with source=CmdLine *)
val map_cmdline : ('a -> 'b) -> 'a sourced list -> 'b list

(** Only uses the elements with source=CmdLine *)
val filter_cmdline : 'a sourced list -> 'a list

val forget_source : 'a sourced -> 'a