From e63db2058943aa49c1b5f2d86d0fe3561ccc3da3 Mon Sep 17 00:00:00 2001 From: herbelin Date: Wed, 29 Nov 2000 11:34:37 +0000 Subject: Ajout d'une option d'alias à -I MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1016 85f007b7-540e-0410-9357-904b9bb8a0f7 --- Makefile | 6 +++--- toplevel/coqtop.ml | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f57afa715..350ebc62f 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ OCAMLOPT_P4O=$(OCAMLOPT) -pp $(CAMLP4O) $(OPTFLAGS) CAMLP4EXTENDFLAGS=-I . pa_extend.cmo q_MLast.cmo CAMLP4DEPS=sed -n -e 's|^(\*.*camlp4deps: "\(.*\)".*\*)$$|\1|p' -COQINCLUDES=-I states -R theories -R contrib +COQINCLUDES=-I states -R theories=Coq -R contrib=Coq # -I contrib/omega -I contrib/ring -I contrib/xml \ # -I theories/Init -I theories/Logic -I theories/Arith \ # -I theories/Bool -I theories/Zarith -I theories/Lists \ @@ -224,7 +224,7 @@ INITVO=theories/Init/Datatypes.vo theories/Init/Peano.vo \ theories/Init/Logic_TypeSyntax.vo theories/Init/%.vo: theories/Init/%.v states/barestate.coq $(COQC) - $(COQC) -$(BEST) -bindir bin -q -R theories -is states/barestate.coq $< + $(COQC) -$(BEST) -bindir bin -q -R theories=Coq -is states/barestate.coq $< init: $(INITVO) @@ -235,7 +235,7 @@ tactics/%.vo: tactics/%.v states/barestate.coq $(COQC) $(COQC) -$(BEST) -bindir bin -q -I tactics -is states/barestate.coq $< states/initial.coq: states/barestate.coq states/MakeInitial.v $(INITVO) $(TACTICSVO) $(BESTCOQTOP) - $(BESTCOQTOP) -q -batch -silent -is states/barestate.coq -I tactics -R theories -load-vernac-source states/MakeInitial.v -outputstate states/initial.coq + $(BESTCOQTOP) -q -batch -silent -is states/barestate.coq -I tactics -R theories=Coq -load-vernac-source states/MakeInitial.v -outputstate states/initial.coq clean:: rm -f states/*~ states/*.coq diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index b0595cf78..53163a4a1 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -77,16 +77,27 @@ let usage () = flush stderr ; exit 1 +let parse_include d = + try + let pos = String.index d '=' in + (String.sub d 0 pos, + Names.dirpath_of_string (String.sub d (pos+1) (String.length d - pos -1))) + with Not_found -> + let alias = Filename.basename d in + if not (Names.is_ident alias) then + error ("Cannot find a name to which "^d^" may map in Coq library"); + (d, [alias]) + let warning s = wARNING [< 'sTR s >] let parse_args () = let rec parse = function | [] -> () - | ("-I"|"-include") :: d :: rem -> push_include d; parse rem + | ("-I"|"-include") :: d :: rem -> push_include (parse_include d);parse rem | ("-I"|"-include") :: [] -> usage () - | "-R" :: d :: rem -> push_rec_include d; parse rem + | "-R" :: d :: rem -> push_rec_include (parse_include d); parse rem | "-R" :: [] -> usage () | "-q" :: rem -> no_load_rc (); parse rem -- cgit v1.2.3