diff options
author | Sébastien Hinderer <Sebastien.Hinderer@inria.fr> | 2022-09-07 11:22:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 11:22:45 +0200 |
commit | 5ece6d65b11b936aca03923ef804f64672000436 (patch) | |
tree | 4bf706efb794e5b6c3e3c2ab87929b094178296e | |
parent | bb375e46fffa91b3152c8f75997c77e0df6b0f33 (diff) | |
parent | 49410858edd321e7c272a3002d1f2b0a09a200c3 (diff) | |
download | ocaml-5ece6d65b11b936aca03923ef804f64672000436.tar.gz |
Merge pull request #11420 from shindere/merge-lex-makefile
Merge lex/Makefile into the root Makefile
-rw-r--r-- | .depend | 121 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile | 83 | ||||
-rw-r--r-- | Makefile.build_config.in | 27 | ||||
-rw-r--r-- | Makefile.common | 2 | ||||
-rwxr-xr-x | configure | 5 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | debugger/Makefile | 2 | ||||
-rw-r--r-- | lex/.depend | 121 | ||||
-rw-r--r-- | lex/Makefile | 86 | ||||
-rw-r--r-- | ocamldoc/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tools/Makefile | 2 |
12 files changed, 213 insertions, 245 deletions
@@ -6738,3 +6738,124 @@ toplevel/native/trace.cmi : \ typing/path.cmi \ parsing/longident.cmi \ typing/env.cmi +lex/common.cmo : \ + lex/syntax.cmi \ + lex/lexgen.cmi \ + lex/common.cmi +lex/common.cmx : \ + lex/syntax.cmx \ + lex/lexgen.cmx \ + lex/common.cmi +lex/common.cmi : \ + lex/syntax.cmi \ + lex/lexgen.cmi +lex/compact.cmo : \ + lex/table.cmi \ + lex/lexgen.cmi \ + lex/compact.cmi +lex/compact.cmx : \ + lex/table.cmx \ + lex/lexgen.cmx \ + lex/compact.cmi +lex/compact.cmi : \ + lex/lexgen.cmi +lex/cset.cmo : \ + lex/cset.cmi +lex/cset.cmx : \ + lex/cset.cmi +lex/cset.cmi : +lex/lexer.cmo : \ + lex/syntax.cmi \ + lex/parser.cmi \ + lex/lexer.cmi +lex/lexer.cmx : \ + lex/syntax.cmx \ + lex/parser.cmx \ + lex/lexer.cmi +lex/lexer.cmi : \ + lex/parser.cmi +lex/lexgen.cmo : \ + lex/table.cmi \ + lex/syntax.cmi \ + lex/cset.cmi \ + lex/lexgen.cmi +lex/lexgen.cmx : \ + lex/table.cmx \ + lex/syntax.cmx \ + lex/cset.cmx \ + lex/lexgen.cmi +lex/lexgen.cmi : \ + lex/syntax.cmi +lex/main.cmo : \ + lex/syntax.cmi \ + lex/parser.cmi \ + lex/outputbis.cmi \ + lex/output.cmi \ + lex/lexgen.cmi \ + lex/lexer.cmi \ + lex/cset.cmi \ + lex/compact.cmi \ + lex/common.cmi \ + lex/main.cmi +lex/main.cmx : \ + lex/syntax.cmx \ + lex/parser.cmx \ + lex/outputbis.cmx \ + lex/output.cmx \ + lex/lexgen.cmx \ + lex/lexer.cmx \ + lex/cset.cmx \ + lex/compact.cmx \ + lex/common.cmx \ + lex/main.cmi +lex/main.cmi : +lex/output.cmo : \ + lex/lexgen.cmi \ + lex/compact.cmi \ + lex/common.cmi \ + lex/output.cmi +lex/output.cmx : \ + lex/lexgen.cmx \ + lex/compact.cmx \ + lex/common.cmx \ + lex/output.cmi +lex/output.cmi : \ + lex/syntax.cmi \ + lex/lexgen.cmi \ + lex/compact.cmi \ + lex/common.cmi +lex/outputbis.cmo : \ + lex/lexgen.cmi \ + lex/common.cmi \ + lex/outputbis.cmi +lex/outputbis.cmx : \ + lex/lexgen.cmx \ + lex/common.cmx \ + lex/outputbis.cmi +lex/outputbis.cmi : \ + lex/syntax.cmi \ + lex/lexgen.cmi \ + lex/common.cmi +lex/parser.cmo : \ + lex/syntax.cmi \ + lex/cset.cmi \ + lex/parser.cmi +lex/parser.cmx : \ + lex/syntax.cmx \ + lex/cset.cmx \ + lex/parser.cmi +lex/parser.cmi : \ + lex/syntax.cmi +lex/syntax.cmo : \ + lex/cset.cmi \ + lex/syntax.cmi +lex/syntax.cmx : \ + lex/cset.cmx \ + lex/syntax.cmi +lex/syntax.cmi : \ + lex/cset.cmi +lex/table.cmo : \ + lex/table.cmi +lex/table.cmx : \ + lex/table.cmi +lex/table.cmi : diff --git a/.gitignore b/.gitignore index 2e8443db53..5b49c11b06 100644 --- a/.gitignore +++ b/.gitignore @@ -83,6 +83,7 @@ META /debugger/debugger_lexer.ml /debugger/debugger_parser.ml /debugger/debugger_parser.mli +/debugger/debugger_parser.output /debugger/ocamldebug /emacs/ocamltags @@ -132,6 +133,7 @@ META /ocamltest/tsl_lexer.ml /ocamltest/tsl_parser.ml /ocamltest/tsl_parser.mli +/ocamltest/tsl_parser.output /ocamltest/ocamltest.html /otherlibs/*/.dep @@ -202,6 +204,7 @@ META /testsuite/tools/lexcmm.ml /testsuite/tools/parsecmm.ml /testsuite/tools/parsecmm.mli +/testsuite/tools/parsecmm.output /tools/ocamldep /tools/ocamldep.opt @@ -35,18 +35,13 @@ endif include stdlib/StdlibModules -CAMLC = $(BOOT_OCAMLC) $(BOOT_STDLIBFLAGS) -g -use-prims runtime/primitives -CAMLOPT=$(OCAMLRUN) ./ocamlopt$(EXE) $(STDLIBFLAGS) -g -I otherlibs/dynlink +CAMLC = $(BOOT_OCAMLC) $(BOOT_STDLIBFLAGS) -use-prims runtime/primitives +CAMLOPT=$(OCAMLRUN) ./ocamlopt$(EXE) $(STDLIBFLAGS) -I otherlibs/dynlink ARCHES=amd64 i386 arm arm64 power s390x riscv DIRS = utils parsing typing bytecomp file_formats lambda middle_end \ middle_end/closure middle_end/flambda middle_end/flambda/base_types \ asmcomp driver toplevel INCLUDES = $(addprefix -I ,$(DIRS)) -COMPFLAGS=-strict-sequence -principal -absname \ - -w +a-4-9-40-41-42-44-45-48 \ - -warn-error +a \ - -bin-annot -safe-string -strict-formats $(INCLUDES) -LINKFLAGS= ifeq "$(strip $(NATDYNLINKOPTS))" "" OCAML_NATDYNLINKOPTS= @@ -124,9 +119,12 @@ partialclean:: .PHONY: beforedepend beforedepend:: utils/config.ml utils/domainstate.ml utils/domainstate.mli +ocamllex_PROGRAMS := $(addprefix lex/,ocamllex ocamllex.opt) + ocamlyacc_PROGRAM = yacc/ocamlyacc + PROGRAMS = expunge ocaml ocamlc ocamlc.opt ocamlnat ocamlopt ocamlopt.opt \ - $(ocamlyacc_PROGRAM) + $(ocamllex_PROGRAMS) $(ocamlyacc_PROGRAM) $(foreach PROGRAM, $(PROGRAMS), $(eval $(call PROGRAM_SYNONYM,$(PROGRAM)))) @@ -429,7 +427,7 @@ clean:: partialclean ocamlc$(EXE): compilerlibs/ocamlcommon.cma \ compilerlibs/ocamlbytecomp.cma $(BYTESTART) - $(CAMLC) $(LINKFLAGS) -compat-32 -o $@ $^ + $(CAMLC) $(OC_COMMON_LDFLAGS) -compat-32 -o $@ $^ partialclean:: rm -rf ocamlc$(EXE) @@ -438,7 +436,7 @@ partialclean:: ocamlopt$(EXE): compilerlibs/ocamlcommon.cma compilerlibs/ocamloptcomp.cma \ $(OPTSTART) - $(CAMLC) $(LINKFLAGS) -o $@ $^ + $(CAMLC) $(OC_COMMON_LDFLAGS) -o $@ $^ partialclean:: rm -f ocamlopt$(EXE) @@ -452,7 +450,7 @@ ocaml_dependencies := \ .INTERMEDIATE: ocaml.tmp ocaml.tmp: $(ocaml_dependencies) - $(CAMLC) $(LINKFLAGS) -I toplevel/byte -linkall -o $@ $^ + $(CAMLC) $(OC_COMMON_LDFLAGS) -I toplevel/byte -linkall -o $@ $^ ocaml$(EXE): $(expunge) ocaml.tmp - $(OCAMLRUN) $^ $@ $(PERVASIVES) @@ -499,7 +497,7 @@ beforedepend:: parsing/lexer.ml ocamlc.opt$(EXE): compilerlibs/ocamlcommon.cmxa \ compilerlibs/ocamlbytecomp.cmxa $(BYTESTART:.cmo=.cmx) - $(CAMLOPT_CMD) $(LINKFLAGS) -o $@ $^ -cclib "$(BYTECCLIBS)" + $(CAMLOPT_CMD) $(OC_COMMON_LDFLAGS) -o $@ $^ -cclib "$(BYTECCLIBS)" partialclean:: rm -f ocamlc.opt$(EXE) @@ -510,7 +508,7 @@ ocamlopt.opt$(EXE): \ compilerlibs/ocamlcommon.cmxa \ compilerlibs/ocamloptcomp.cmxa \ $(OPTSTART:.cmo=.cmx) - $(CAMLOPT_CMD) $(LINKFLAGS) -o $@ $^ + $(CAMLOPT_CMD) $(OC_COMMON_LDFLAGS) -o $@ $^ partialclean:: rm -f ocamlopt.opt$(EXE) @@ -570,7 +568,7 @@ $(cvt_emit): tools/cvt_emit.mll $(expunge): compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \ toplevel/expunge.cmo - $(CAMLC) $(LINKFLAGS) -o $@ $^ + $(CAMLC) $(OC_COMMON_LDFLAGS) -o $@ $^ partialclean:: rm -f $(expunge) @@ -1047,7 +1045,7 @@ clean:: # Dependencies subdirs = stdlib $(addprefix otherlibs/, $(ALL_OTHERLIBS)) \ - debugger lex ocamldoc ocamltest tools + debugger ocamldoc ocamltest tools .PHONY: alldepend alldepend: depend @@ -1072,18 +1070,39 @@ libraryopt: partialclean:: $(MAKE) -C stdlib clean -# The lexer and parser generators +# The lexer generator + +ocamllex_MODULES = $(addprefix lex/,\ + cset syntax parser lexer table lexgen compact common output outputbis main) + +.PHONY: lex-all +lex-all: lex/ocamllex + +.PHONY: lex-allopt +lex-allopt: lex/ocamllex.opt .PHONY: ocamllex ocamllex: ocamlyacc - $(MAKE) -C lex all + $(MAKE) lex-all .PHONY: ocamllex.opt ocamllex.opt: ocamlopt - $(MAKE) -C lex allopt + $(MAKE) lex-allopt + +lex/ocamllex$(EXE): $(ocamllex_MODULES:=.cmo) + $(CAMLC) $(LINKFLAGS) -compat-32 -o $@ $^ + +lex/ocamllex.opt$(EXE): $(ocamllex_MODULES:=.cmx) + $(CAMLOPT_CMD) $(LINKFLAGS) -o $@ $^ partialclean:: - $(MAKE) -C lex clean + rm -f lex/*.cm* lex/*.o lex/*.obj + +beforedepend:: lex/parser.ml lex/parser.mli lex/lexer.ml + +clean:: + rm -f lex/parser.ml lex/parser.mli lex/parser.output + rm -f lex/lexer.ml # The ocamlyacc parser generator @@ -1322,18 +1341,17 @@ ocamlnat_dependencies := \ $(TOPLEVELSTART:.cmo=.cmx) ocamlnat$(EXE): $(ocamlnat_dependencies) - $(CAMLOPT_CMD) $(LINKFLAGS) -linkall -I toplevel/native -o $@ $^ + $(CAMLOPT_CMD) $(OC_COMMON_LDFLAGS) -linkall -I toplevel/native -o $@ $^ + +COMPILE_NATIVE_MODULE = \ + $(CAMLOPT_CMD) $(OC_COMMON_CFLAGS) -I $(@D) $(INCLUDES) $(OC_NATIVE_CFLAGS) -toplevel/topdirs.cmx: toplevel/topdirs.ml - $(CAMLOPT_CMD) $(COMPFLAGS) $(OPTCOMPFLAGS) -I toplevel/native -c $< +toplevel/topdirs.cmx toplevel/toploop.cmx $(TOPLEVELSTART:.cmo=.cmx): \ + OC_NATIVE_CFLAGS += -I toplevel/native -$(TOPLEVELINIT:.cmo=.cmx): $(TOPLEVELINIT:.cmo=.ml) \ - toplevel/native/topeval.cmx - $(CAMLOPT_CMD) $(COMPFLAGS) $(OPTCOMPFLAGS) -I toplevel/native -c $< +$(TOPLEVELINIT:.cmo=.cmx): toplevel/native/topeval.cmx -$(TOPLEVELSTART:.cmo=.cmx): $(TOPLEVELSTART:.cmo=.ml) \ - toplevel/native/topmain.cmx - $(CAMLOPT_CMD) $(COMPFLAGS) $(OPTCOMPFLAGS) -I toplevel/native -c $< +$(TOPLEVELSTART:.cmo=.cmx): toplevel/native/topmain.cmx partialclean:: rm -f ocamlnat ocamlnat.exe @@ -1366,13 +1384,13 @@ endif # Default rules %.cmo: %.ml - $(CAMLC) $(COMPFLAGS) -c $< -I $(@D) + $(CAMLC) $(OC_COMMON_CFLAGS) -I $(@D) $(INCLUDES) -c $< %.cmi: %.mli - $(CAMLC) $(COMPFLAGS) -c $< + $(CAMLC) $(OC_COMMON_CFLAGS) -I $(@D) $(INCLUDES) -c $< %.cmx: %.ml - $(CAMLOPT) $(COMPFLAGS) $(OPTCOMPFLAGS) -c $< -I $(@D) + $(COMPILE_NATIVE_MODULE) -c $< partialclean:: for d in utils parsing typing bytecomp asmcomp middle_end file_formats \ @@ -1388,7 +1406,7 @@ depend: beforedepend (for d in utils parsing typing bytecomp asmcomp middle_end \ lambda file_formats middle_end/closure middle_end/flambda \ middle_end/flambda/base_types \ - driver toplevel toplevel/byte toplevel/native; \ + driver toplevel toplevel/byte toplevel/native lex; \ do \ $(OCAMLDEP) $(OC_OCAMLDEPFLAGS) -I $$d $(INCLUDES) \ $(OCAMLDEPFLAGS) $$d/*.mli $$d/*.ml \ @@ -1398,7 +1416,6 @@ depend: beforedepend .PHONY: distclean distclean: clean $(MAKE) -C debugger distclean - $(MAKE) -C lex distclean $(MAKE) -C manual distclean $(MAKE) -C ocamldoc distclean $(MAKE) -C ocamltest distclean diff --git a/Makefile.build_config.in b/Makefile.build_config.in index 05e7797045..8ccf43bb19 100644 --- a/Makefile.build_config.in +++ b/Makefile.build_config.in @@ -70,6 +70,33 @@ MKDLL_EXP=@mkdll_exp@ DEFAULT_BUILD_TARGET = @default_build_target@ +# Flags to use when compiling and linking OCaml programs + +# The names of the variables below take the form XXX_YYY_ZZZ where +# +# XXX is one of OC, OCAML or the name of a module. The OC prefix +# is for private variables (i.e. reserved by the compiler's build system), +# the OCAML prefix is used for variables the user can define to add their +# own flags and the module-name prefix is for flags that apply only +# to one module. +# +# YYY refers to the backend. At the moment, it can take the values +# COMMON for the flags shared by all the backends, BYTECODE or NATIVE +# (other backends may be added in the future). +# +# ZZZ is either CFLAGS (compile-time flags) or LDFLAGS (link-time flags). +# However, contrary to what is done for C compilers, the flags in the +# CFLAGS category are not passed at link time, so if a flag is needed +# at both stages, like e.g. -g, it should be added to both XXX_YYY_CFLAGS and +# XXX_YYY_LDFLAGS. + +OC_COMMON_CFLAGS = -g -strict-sequence -principal -absname \ + -w +a-4-9-40-41-42-44-45-48 -warn-error +a -bin-annot \ + -safe-string -strict-formats +OC_COMMON_LDFLAGS = -g + +OC_NATIVE_CFLAGS = @oc_native_cflags@ + # Platform-dependent assembler files to use to build the runtime runtime_ASM_OBJECTS = $(addprefix runtime/,@runtime_asm_objects@) diff --git a/Makefile.common b/Makefile.common index 63afbd5e25..35ee040af6 100644 --- a/Makefile.common +++ b/Makefile.common @@ -193,7 +193,7 @@ OCAMLLEXFLAGS ?= -q OCAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE) -OCAMLYACCFLAGS ?= +OCAMLYACCFLAGS ?= --strict -v %.ml %.mli: %.mly $(OCAMLYACC) $(OCAMLYACCFLAGS) $< @@ -758,6 +758,7 @@ PACKLD flexdll_chain flexlink_cmd afl +oc_native_cflags function_sections flat_float_array windows_unicode @@ -2969,6 +2970,7 @@ OCAML_VERSION_SHORT=5.1 + ## Generated files ac_config_files="$ac_config_files Makefile.build_config" @@ -18035,6 +18037,8 @@ esac fi +oc_native_cflags='' + if test x"$enable_function_sections" = "xno"; then : function_sections=false else @@ -18062,6 +18066,7 @@ $as_echo "$as_me: Function sections are not supported in Clang prior to version 3.5." >&6;} ;; #( gcc-*|clang-*) : function_sections=true; + oc_native_cflags='-function-sections' internal_cflags="$internal_cflags -ffunction-sections"; $as_echo "#define FUNCTION_SECTIONS 1" >>confdefs.h ;; #( diff --git a/configure.ac b/configure.ac index d2e71871fb..037d94a7c1 100644 --- a/configure.ac +++ b/configure.ac @@ -167,6 +167,7 @@ AC_SUBST([cmm_invariants]) AC_SUBST([windows_unicode]) AC_SUBST([flat_float_array]) AC_SUBST([function_sections]) +AC_SUBST([oc_native_cflags]) AC_SUBST([afl]) AC_SUBST([flexlink_cmd]) AC_SUBST([flexdll_chain]) @@ -2024,6 +2025,8 @@ AS_IF([test x"$enable_mmap_map_stack" = "xyes"], [with_mmap_map_stack=false]) ]) +oc_native_cflags='' + AS_IF([test x"$enable_function_sections" = "xno"], [function_sections=false], [AS_CASE([$arch], @@ -2044,6 +2047,7 @@ AS_IF([test x"$enable_function_sections" = "xno"], in Clang prior to version 3.5.])], [gcc-*|clang-*], [function_sections=true; + oc_native_cflags='-function-sections' internal_cflags="$internal_cflags -ffunction-sections"; AC_DEFINE([FUNCTION_SECTIONS])], [*], diff --git a/debugger/Makefile b/debugger/Makefile index d076f5bb12..47df37bc86 100644 --- a/debugger/Makefile +++ b/debugger/Makefile @@ -85,7 +85,7 @@ clean:: beforedepend:: debugger_lexer.ml clean:: - rm -f debugger_parser.ml debugger_parser.mli + rm -f $(addprefix debugger_parser.,ml mli output) beforedepend:: debugger_parser.ml debugger_parser.mli include .depend diff --git a/lex/.depend b/lex/.depend deleted file mode 100644 index 1f18d58eed..0000000000 --- a/lex/.depend +++ /dev/null @@ -1,121 +0,0 @@ -common.cmo : \ - syntax.cmi \ - lexgen.cmi \ - common.cmi -common.cmx : \ - syntax.cmx \ - lexgen.cmx \ - common.cmi -common.cmi : \ - syntax.cmi \ - lexgen.cmi -compact.cmo : \ - table.cmi \ - lexgen.cmi \ - compact.cmi -compact.cmx : \ - table.cmx \ - lexgen.cmx \ - compact.cmi -compact.cmi : \ - lexgen.cmi -cset.cmo : \ - cset.cmi -cset.cmx : \ - cset.cmi -cset.cmi : -lexer.cmo : \ - syntax.cmi \ - parser.cmi \ - lexer.cmi -lexer.cmx : \ - syntax.cmx \ - parser.cmx \ - lexer.cmi -lexer.cmi : \ - parser.cmi -lexgen.cmo : \ - table.cmi \ - syntax.cmi \ - cset.cmi \ - lexgen.cmi -lexgen.cmx : \ - table.cmx \ - syntax.cmx \ - cset.cmx \ - lexgen.cmi -lexgen.cmi : \ - syntax.cmi -main.cmo : \ - syntax.cmi \ - parser.cmi \ - outputbis.cmi \ - output.cmi \ - lexgen.cmi \ - lexer.cmi \ - cset.cmi \ - compact.cmi \ - common.cmi \ - main.cmi -main.cmx : \ - syntax.cmx \ - parser.cmx \ - outputbis.cmx \ - output.cmx \ - lexgen.cmx \ - lexer.cmx \ - cset.cmx \ - compact.cmx \ - common.cmx \ - main.cmi -main.cmi : -output.cmo : \ - lexgen.cmi \ - compact.cmi \ - common.cmi \ - output.cmi -output.cmx : \ - lexgen.cmx \ - compact.cmx \ - common.cmx \ - output.cmi -output.cmi : \ - syntax.cmi \ - lexgen.cmi \ - compact.cmi \ - common.cmi -outputbis.cmo : \ - lexgen.cmi \ - common.cmi \ - outputbis.cmi -outputbis.cmx : \ - lexgen.cmx \ - common.cmx \ - outputbis.cmi -outputbis.cmi : \ - syntax.cmi \ - lexgen.cmi \ - common.cmi -parser.cmo : \ - syntax.cmi \ - cset.cmi \ - parser.cmi -parser.cmx : \ - syntax.cmx \ - cset.cmx \ - parser.cmi -parser.cmi : \ - syntax.cmi -syntax.cmo : \ - cset.cmi \ - syntax.cmi -syntax.cmx : \ - cset.cmx \ - syntax.cmi -syntax.cmi : \ - cset.cmi -table.cmo : \ - table.cmi -table.cmx : \ - table.cmi -table.cmi : diff --git a/lex/Makefile b/lex/Makefile deleted file mode 100644 index 2455a74b58..0000000000 --- a/lex/Makefile +++ /dev/null @@ -1,86 +0,0 @@ -#************************************************************************** -#* * -#* OCaml * -#* * -#* Xavier Leroy, projet Cristal, INRIA Rocquencourt * -#* * -#* Copyright 1999 Institut National de Recherche en Informatique et * -#* en Automatique. * -#* * -#* All rights reserved. This file is distributed under the terms of * -#* the GNU Lesser General Public License version 2.1, with the * -#* special exception on linking described in the file LICENSE. * -#* * -#************************************************************************** - -# The lexer generator - -ROOTDIR = .. - -# NOTE: it is important that the OCAMLDEP and OCAMLLEX variables -# are defined *before* Makefile.common gets included, so that -# their local definitions here take precedence over their -# general shared definitions in Makefile.common. - -OCAMLDEP ?= $(BOOT_OCAMLDEP) -OCAMLLEX ?= $(BOOT_OCAMLLEX) - -include $(ROOTDIR)/Makefile.common - -OCAMLYACCFLAGS = -v - -CAMLC = $(BOOT_OCAMLC) $(BOOT_STDLIBFLAGS) \ - -use-prims $(ROOTDIR)/runtime/primitives -strict-sequence -CAMLOPT = $(OCAMLRUN) $(ROOTDIR)/ocamlopt$(EXE) $(STDLIBFLAGS) -COMPFLAGS = -g -absname -w +a-4-9-41-42-44-45-48 -warn-error +A \ - -safe-string -strict-sequence -strict-formats -bin-annot -LINKFLAGS = -g - -OBJS=cset.cmo syntax.cmo parser.cmo lexer.cmo table.cmo lexgen.cmo \ - compact.cmo common.cmo output.cmo outputbis.cmo main.cmo - -programs := ocamllex ocamllex.opt - -$(foreach program, $(programs), $(eval $(call PROGRAM_SYNONYM,$(program)))) - -.PHONY: all allopt opt.opt # allopt and opt.opt are synonyms -all: ocamllex -allopt: ocamllex.opt -opt.opt: allopt - -ocamllex$(EXE): $(OBJS) - $(CAMLC) $(LINKFLAGS) -compat-32 -o $@ $^ - -ocamllex.opt$(EXE): $(OBJS:.cmo=.cmx) - $(CAMLOPT_CMD) $(LINKFLAGS) -o $@ $^ - -clean:: - rm -f $(programs) $(programs:=.exe) - rm -f *.cmo *.cmi *.cmx *.cmt *.cmti *.o *.obj - -clean:: - rm -f parser.ml parser.mli parser.output - -.PHONY: distclean -distclean: clean - -beforedepend:: parser.ml parser.mli - -clean:: - rm -f lexer.ml - -beforedepend:: lexer.ml - -%.cmo: %.ml - $(CAMLC) -c $(COMPFLAGS) $< - -%.cmi: %.mli - $(CAMLC) -c $(COMPFLAGS) $< - -%.cmx: %.ml - $(CAMLOPT) -c $(COMPFLAGS) $< - -depend: beforedepend - $(OCAMLDEP_CMD) *.mli *.ml > .depend - -include .depend diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile index 763e23f2aa..7f65403414 100644 --- a/ocamldoc/Makefile +++ b/ocamldoc/Makefile @@ -18,8 +18,6 @@ ROOTDIR = .. include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries -OCAMLYACCFLAGS = --strict -v - OCAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS) OCAMLOPT = $(BEST_OCAMLOPT) $(STDLIBFLAGS) diff --git a/testsuite/tools/Makefile b/testsuite/tools/Makefile index 64ef8719d5..a344bf0bbf 100644 --- a/testsuite/tools/Makefile +++ b/testsuite/tools/Makefile @@ -94,7 +94,7 @@ asmgen_i386.obj: asmgen_i386nt.asm clean: rm -f *.cm* *.o *.obj rm -f expect_test expect_test.exe codegen codegen.exe - rm -f parsecmm.ml parsecmm.mli lexcmm.ml + rm -f parsecmm.ml parsecmm.mli parsecmm.output lexcmm.ml .PHONY: distclean distclean: clean |