From 002a974b66bc5b8524c8c045d6b9ec4f57aa7734 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Thu, 8 Nov 2018 13:17:14 +0100 Subject: [gramlib] [build] Switch make-based system to packed gramlib This makes the make-based build system stop linking to Camlp5's gramlib and instead links to our own gramlib. We use the style done in the packing of `Stdlib` in OCaml 4.07. As to introduce a minimal amount of noise in history we use an autogenerated `gramlib__pack` directory. Co-authored-by: Gaƫtan Gilbert --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e0ab169eda..023578f94a 100644 --- a/Makefile +++ b/Makefile @@ -94,6 +94,10 @@ EXISTINGMLI := $(call find, '*.mli') ## Files that will be generated GENMLGFILES:= $(MLGFILES:.mlg=.ml) +# GRAMFILES must be in linking order +export GRAMFILES=$(addprefix gramlib__pack/gramlib__,Ploc Plexing Gramext Grammar) +export GRAMMLFILES := $(addsuffix .ml, $(GRAMFILES)) $(addsuffix .mli, $(GRAMFILES)) +export GENGRAMFILES := $(GRAMMLFILES) gramlib__pack/gramlib.ml export GENMLFILES:=$(LEXFILES:.mll=.ml) $(YACCFILES:.mly=.ml) $(GENMLGFILES) ide/coqide_os_specific.ml kernel/copcodes.ml export GENHFILES:=kernel/byterun/coq_jumptbl.h export GENFILES:=$(GENMLFILES) $(GENMLIFILES) $(GENHFILES) @@ -190,12 +194,16 @@ META.coq: META.coq.in .PHONY: clean cleankeepvo objclean cruftclean indepclean docclean archclean optclean clean-ide mlgclean depclean cleanconfig distclean voclean timingclean alienclean -clean: objclean cruftclean depclean docclean camldevfilesclean +clean: objclean cruftclean depclean docclean camldevfilesclean gramlibclean cleankeepvo: indepclean clean-ide optclean cruftclean depclean docclean objclean: archclean indepclean +.PHONY: gramlibclean +gramlibclean: + rm -rf gramlib__pack/ + cruftclean: mlgclean find . \( -name '*~' -o -name '*.annot' \) -exec rm -f {} + rm -f gmon.out core @@ -284,7 +292,7 @@ KNOWNML:=$(EXISTINGML) $(GENMLFILES) $(MLPACKFILES:.mlpack=.ml) \ $(patsubst %.mlp,%.ml,$(wildcard grammar/*.mlp)) KNOWNOBJS:=$(KNOWNML:.ml=.cmo) $(KNOWNML:.ml=.cmx) $(KNOWNML:.ml=.cmi) \ $(MLIFILES:.mli=.cmi) \ - $(MLLIBFILES:.mllib=.cma) $(MLLIBFILES:.mllib=.cmxa) grammar/grammar.cma + gramlib__pack/gramlib.cma gramlib__pack/gramlib.cmxa $(MLLIBFILES:.mllib=.cma) $(MLLIBFILES:.mllib=.cmxa) grammar/grammar.cma ALIENOBJS:=$(filter-out $(KNOWNOBJS),$(EXISTINGOBJS)) alienclean: -- cgit v1.2.3