aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gregory Malecha <gmalecha@gmail.com>2016-02-10 10:35:01 -0800
committerGravatar Maxime Dénès <mail@maximedenes.fr>2016-03-24 17:36:51 +0100
commit396b598ba6984169e4215b1400989c3c67abc1aa (patch)
tree9337d8ccd0b43805aaa08c52f9c5466879384d4b
parent31ffc14b4b8d531777042d3ff02f34985bcec084 (diff)
add a .merlin target to the makefile
-rw-r--r--tools/coq_makefile.ml34
1 files changed, 28 insertions, 6 deletions
diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml
index c4b761827..ff4b8bd60 100644
--- a/tools/coq_makefile.ml
+++ b/tools/coq_makefile.ml
@@ -43,6 +43,16 @@ let section s =
print_com (String.make (l+2) '#');
print "\n"
+(* These are the Coq library directories that are used for
+ * plugin development
+ *)
+let lib_dirs =
+ ["kernel"; "lib"; "library"; "parsing";
+ "pretyping"; "interp"; "printing"; "intf";
+ "proofs"; "tactics"; "tools"; "toplevel";
+ "stm"; "grammar"; "config"]
+
+
let usage () =
output_string stderr "Usage summary:
@@ -452,12 +462,8 @@ let variables is_install opt (args,defs) =
end;
(* Caml executables and relative variables *)
if !some_ml4file || !some_mlfile || !some_mlifile then begin
- print "COQSRCLIBS?=-I \"$(COQLIB)kernel\" -I \"$(COQLIB)lib\" \\
- -I \"$(COQLIB)library\" -I \"$(COQLIB)parsing\" -I \"$(COQLIB)pretyping\" \\
- -I \"$(COQLIB)interp\" -I \"$(COQLIB)printing\" -I \"$(COQLIB)intf\" \\
- -I \"$(COQLIB)proofs\" -I \"$(COQLIB)tactics\" -I \"$(COQLIB)tools\" \\
- -I \"$(COQLIB)toplevel\" -I \"$(COQLIB)stm\" -I \"$(COQLIB)grammar\" \\
- -I \"$(COQLIB)config\"";
+ print "COQSRCLIBS?=" ;
+ List.iter (fun c -> print "-I \"$(COQLIB)"; print c ; print "\" \\\n") lib_dirs ;
List.iter (fun c -> print " \\
-I \"$(COQLIB)/"; print c; print "\"") Coq_config.plugins_dirs; print "\n";
print "ZFLAGS=$(OCAMLLIBS) $(COQSRCLIBS) -I $(CAMLP4LIB)\n\n";
@@ -799,6 +805,21 @@ let check_overlapping_include (_,inc_i,inc_r) =
Printf.eprintf "Warning: in options -R/-Q, %s and %s overlap\n" pdir pdir') l;
in aux (inc_i@inc_r)
+(* Generate a .merlin file that references the standard library and
+ * any -I included paths.
+ *)
+let merlin targets (ml_inc,_,_) =
+ print ".merlin:\n";
+ print "\t@echo 'FLG -rectypes' > .merlin\n" ;
+ List.iter (fun c ->
+ print "\t@echo \"B $(COQLIB)" ; print c ; print "\" >> .merlin\n")
+ lib_dirs ;
+ List.iter (fun (_,c) ->
+ print "\t@echo \"B " ; print c ; print "\" >> .merlin\n" ;
+ print "\t@echo \"S " ; print c ; print "\" >> .merlin\n")
+ ml_inc;
+ print "\n"
+
let do_makefile args =
let has_file var = function
|[] -> var := false
@@ -841,6 +862,7 @@ let do_makefile args =
section "Special targets.";
standard opt;
install targets inc is_install;
+ merlin targets inc;
clean sds sps;
make_makefile sds;
implicit ();