diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | Makefile.common | 24 | ||||
-rw-r--r-- | debugger/Makefile | 6 | ||||
-rw-r--r-- | lex/Makefile | 8 | ||||
-rw-r--r-- | ocamldoc/Makefile | 7 | ||||
-rw-r--r-- | ocamltest/Makefile | 9 | ||||
-rw-r--r-- | tools/Makefile | 4 |
7 files changed, 23 insertions, 41 deletions
@@ -53,7 +53,6 @@ else OCAML_NATDYNLINKOPTS = -ccopt "$(NATDYNLINKOPTS)" endif -BOOT_OCAMLLEX ?= $(CAMLRUN) $(ROOTDIR)/boot/ocamllex OCAMLLEX ?= $(BOOT_OCAMLLEX) CAMLDEP=$(CAMLRUN) boot/ocamlc -depend DEPFLAGS=-slash @@ -650,10 +649,7 @@ natruntop: otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/native/dynlink.ml $(MAKE) -C otherlibs/dynlink allopt -# The lexer - -%.ml: %.mll - $(OCAMLLEX) $(OCAMLLEXFLAGS) $< +# Cleanup the lexer partialclean:: rm -f parsing/lexer.ml diff --git a/Makefile.common b/Makefile.common index af979b789f..1e0486615f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -66,8 +66,6 @@ OPTCOMPFLAGS= ifeq "$(FUNCTION_SECTIONS)" "true" OPTCOMPFLAGS += -function-sections endif -# By default, request ocamllex to be quiet -OCAMLLEXFLAGS ?= -q # Escape special characters in the argument string. # There are four characters that need escaping: @@ -120,3 +118,25 @@ ifneq ($(EXE),) $(1): $(1)$(EXE) endif endef # PROGRAM_SYNONYM + +# Lexer generation + +BOOT_OCAMLLEX ?= $(CAMLRUN) $(ROOTDIR)/boot/ocamllex +# The OCAMLLEX command used in the recipe below is defined in the individual +# makefiles, because its default value is directory-specific. +# By default, some directories use BOOT_OCAMLLEX while others use the +# freshly compiled lexer generator. + +OCAMLLEXFLAGS ?= -q + +%.ml: %.mll + $(OCAMLLEX) $(OCAMLLEXFLAGS) $< + +# Parser generation + +OCAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE) + +OCAMLYACCFLAGS ?= + +%.ml %.mli: %.mly + $(OCAMLYACC) $(OCAMLYACCFLAGS) $< diff --git a/debugger/Makefile b/debugger/Makefile index 8c8c1b4b0c..50695f2b05 100644 --- a/debugger/Makefile +++ b/debugger/Makefile @@ -20,8 +20,6 @@ include $(ROOTDIR)/Makefile.best_binaries DYNLINKDIR=$(ROOTDIR)/otherlibs/dynlink UNIXDIR=$(ROOTDIR)/otherlibs/$(UNIXLIB) -OCAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE) -OCAMLYACCFLAGS = CAMLC=$(BEST_OCAMLC) -g -nostdlib -I $(ROOTDIR)/stdlib COMPFLAGS=$(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A \ @@ -78,14 +76,10 @@ depend: beforedepend $(CAMLDEP) $(DEPFLAGS) $(DEPINCLUDES) *.mli *.ml \ | sed -e 's,$(UNIXDIR)/,$$(UNIXDIR)/,' > .depend -%.ml: %.mll - $(OCAMLLEX) $(OCAMLLEXFLAGS) $< clean:: rm -f debugger_lexer.ml beforedepend:: debugger_lexer.ml -%.ml %.mli: %.mly - $(OCAMLYACC) $(OCAMLYACCFLAGS) $< clean:: rm -f debugger_parser.ml debugger_parser.mli beforedepend:: debugger_parser.ml debugger_parser.mli diff --git a/lex/Makefile b/lex/Makefile index adc768e0a4..43ce59faa5 100644 --- a/lex/Makefile +++ b/lex/Makefile @@ -19,7 +19,6 @@ ROOTDIR = .. include $(ROOTDIR)/Makefile.common -OCAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE) OCAMLYACCFLAGS = -v CAMLC = $(BOOT_OCAMLC) -strict-sequence -nostdlib \ @@ -28,7 +27,6 @@ CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt$(EXE) -nostdlib -I $(ROOTDIR)/stdlib COMPFLAGS = -absname -w +a-4-9-41-42-44-45-48 -warn-error A \ -safe-string -strict-sequence -strict-formats -bin-annot LINKFLAGS = -BOOT_OCAMLLEX ?= $(CAMLRUN) $(ROOTDIR)/boot/ocamllex OCAMLLEX ?= $(BOOT_OCAMLLEX) CAMLDEP = $(BOOT_OCAMLC) -depend DEPFLAGS = -slash @@ -56,17 +54,11 @@ clean:: rm -f $(programs) $(programs:=.exe) rm -f *.cmo *.cmi *.cmx *.cmt *.cmti *.o *.obj -%.ml %.mli: %.mly - $(OCAMLYACC) $(OCAMLYACCFLAGS) $< - clean:: rm -f parser.ml parser.mli parser.output beforedepend:: parser.ml parser.mli -%.ml: %.mll - $(OCAMLLEX) $(OCAMLLEXFLAGS) $< - clean:: rm -f lexer.ml diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile index 2a9093bac2..92e2af7ffe 100644 --- a/ocamldoc/Makefile +++ b/ocamldoc/Makefile @@ -18,7 +18,6 @@ ROOTDIR = .. include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries -OCAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE) OCAMLYACCFLAGS = --strict -v STDLIBFLAGS = -nostdlib -I $(ROOTDIR)/stdlib @@ -222,12 +221,6 @@ DEPEND_PREREQS = $(LEXERS:.mll=.ml) \ .ml.cmxs: $(OCAMLOPT_CMD) -shared -o $@ $(COMPFLAGS) $< -%.ml: %.mll - $(OCAMLLEX) $(OCAMLLEXFLAGS) $< - -%.ml %.mli: %.mly - $(OCAMLYACC) $(OCAMLYACCFLAGS) $< - # Installation targets ###################### diff --git a/ocamltest/Makefile b/ocamltest/Makefile index 4966f11205..ef8566fcd7 100644 --- a/ocamltest/Makefile +++ b/ocamltest/Makefile @@ -202,9 +202,6 @@ depincludes := OCAMLLEX ?= $(BEST_OCAMLLEX) -OCAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE) -OCAMLYACCFLAGS = - .SECONDARY: $(lexers:.mll=.ml) $(parsers:.mly=.mli) $(parsers:.mly=.ml) .PHONY: all allopt opt.opt # allopt and opt.opt are synonyms @@ -239,12 +236,6 @@ ocamltest.opt$(EXE): $(deps_opt) $(native_modules) %.cmi: %.mli $(deps_byte) $(ocamlc) -c $< -%.ml %.mli: %.mly - $(OCAMLYACC) $(OCAMLYACCFLAGS) $< - -%.ml: %.mll - $(OCAMLLEX) $(OCAMLLEXFLAGS) $< - ocamltest_unix.ml: ocamltest_unix_$(ocamltest_unix).ml echo '# 1 "$^"' > $@ cat $^ >> $@ diff --git a/tools/Makefile b/tools/Makefile index 6929af6727..43564510a7 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -71,7 +71,6 @@ endef CAMLC = $(BOOT_OCAMLC) -g -nostdlib -I $(ROOTDIR)/boot \ -use-prims $(ROOTDIR)/runtime/primitives -I $(ROOTDIR) CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt$(EXE) -g -nostdlib -I $(ROOTDIR)/stdlib -BOOT_OCAMLLEX ?= $(CAMLRUN) $(ROOTDIR)/boot/ocamllex OCAMLLEX ?= $(BOOT_OCAMLLEX) INCLUDES = $(addprefix -I $(ROOTDIR)/,utils parsing typing bytecomp \ middle_end middle_end/closure middle_end/flambda \ @@ -332,9 +331,6 @@ clean:: # Common stuff -%.ml: %.mll - $(OCAMLLEX) $(OCAMLLEXFLAGS) $< - %.cmo: %.ml $(CAMLC) -c $(COMPFLAGS) - $< |