From 396b598ba6984169e4215b1400989c3c67abc1aa Mon Sep 17 00:00:00 2001 From: Gregory Malecha Date: Wed, 10 Feb 2016 10:35:01 -0800 Subject: add a .merlin target to the makefile --- tools/coq_makefile.ml | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index c4b7618270..ff4b8bd600 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 (); -- cgit v1.2.3 From 866b7539cca2bd48c230bc6ddf3acea89cb1450a Mon Sep 17 00:00:00 2001 From: Gregory Malecha Date: Sat, 13 Feb 2016 17:37:36 -0800 Subject: use printf instead of sequenced calls to print. --- tools/coq_makefile.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index ff4b8bd600..80217587d5 100644 --- a/tools/coq_makefile.ml +++ b/tools/coq_makefile.ml @@ -812,11 +812,11 @@ 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") + printf "\t@echo \"B $(COQLIB) %s\" >> .merlin\n" c) lib_dirs ; List.iter (fun (_,c) -> - print "\t@echo \"B " ; print c ; print "\" >> .merlin\n" ; - print "\t@echo \"S " ; print c ; print "\" >> .merlin\n") + printf "\t@echo \"B %s\" >> .merlin\n" c; + printf "\t@echo \"S %s\" >> .merlin\n" c) ml_inc; print "\n" -- cgit v1.2.3