From 9af28924713d14d833dcaf95cd3338ef68fbfc97 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Tue, 7 Jul 2020 14:08:24 +0200 Subject: Bytecode-only build (#243) If ocamlopt (the native-code OCaml compiler) is not available, fall back to building with ocamlc (the bytecode OCaml compiler). Fixes: #359 --- Makefile.extr | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 5948bfc6..b417945b 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -19,7 +19,8 @@ include Makefile.config # # Variables from Makefile.config: -# -OCAML_OPT_COMP: can we use the native version +# -OCAML_NATIVE_COMP: native-code compilation is supported +# -OCAML_OPT_COMP: can we use the natively-compiled compilers # -COMPFLAGS: compile options # -LINK_OPT: additional linker flags for the native binary # @@ -71,6 +72,7 @@ OCAMLDEP=ocamldep$(DOTOPT) -slash $(INCLUDES) OCAMLLEX=ocamllex -q MODORDER=tools/modorder .depend.extr +COPY=cp PARSERS=cparser/pre_parser.mly LEXERS=cparser/Lexer.mll lib/Tokenize.mll \ @@ -88,9 +90,15 @@ ifeq ($(wildcard .depend.extr),.depend.extr) CCOMP_OBJS:=$(shell $(MODORDER) driver/Driver.cmx) +ifeq ($(OCAML_NATIVE_COMP),true) ccomp: $(CCOMP_OBJS) @echo "Linking $@" @$(OCAMLOPT) -o $@ $(LIBS) $(LINK_OPT) $+ +else +ccomp: ccomp.byte + @echo "Copying to $@" + @$(COPY) $+ $@ +endif ccomp.byte: $(CCOMP_OBJS:.cmx=.cmo) @echo "Linking $@" @@ -98,9 +106,15 @@ ccomp.byte: $(CCOMP_OBJS:.cmx=.cmo) CLIGHTGEN_OBJS:=$(shell $(MODORDER) exportclight/Clightgen.cmx) +ifeq ($(OCAML_NATIVE_COMP),true) clightgen: $(CLIGHTGEN_OBJS) @echo "Linking $@" @$(OCAMLOPT) -o $@ $(LIBS) $(LINK_OPT) $+ +else +clightgen: clightgen.byte + @echo "Copying to $@" + @$(COPY) $+ $@ +endif clightgen.byte: $(CLIGHTGEN_OBJS:.cmx=.cmo) @echo "Linking $@" -- cgit From 27beb944ff6ff18ea612c116e414eb40ce1320a6 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 14 Nov 2020 10:09:34 +0100 Subject: Do not use -warn-error when building from a release tarball Stopping on warnings is useful for development builds, but unhelpful for released software. --- Makefile.extr | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index b417945b..23e01614 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -50,13 +50,20 @@ INCLUDES=$(patsubst %,-I %, $(DIRS)) # Control of warnings: -WARNINGS=-w +a-4-9-27 -strict-sequence -safe-string -warn-error +a #Deprication returns with ocaml 4.03 +WARNINGS=-w +a-4-9-27 extraction/%.cmx: WARNINGS +=-w -20-27-32..34-39-41-44..45-60-67 extraction/%.cmo: WARNINGS +=-w -20-27-32..34-39-41-44..45-60-67 cparser/pre_parser.cmx: WARNINGS += -w -41 cparser/pre_parser.cmo: WARNINGS += -w -41 -COMPFLAGS+=-g $(INCLUDES) -I "$(MENHIR_DIR)" $(WARNINGS) +# Turn warnings into errors, but not for released tarballs +ifeq ($(wildcard .git),.git) +WARN_ERRORS=-warn-error +a +else +WARN_ERRORS= +endif + +COMPFLAGS+=-g -strict-sequence -safe-string $(INCLUDES) -I "$(MENHIR_DIR)" $(WARNINGS) $(WARN_ERRORS) # Using .opt compilers if available -- cgit From f2fb8540c94ceb9892510f83bd7d6734fe9d422f Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 4 Dec 2020 17:19:46 +0100 Subject: Fixing compilation for KVX --- Makefile.extr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 0f71c8e1..4f1c3c65 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -51,7 +51,7 @@ INCLUDES=$(patsubst %,-I %, $(DIRS)) # Control of warnings: # WARNINGS=-w +a-4-9-27-42 -strict-sequence -safe-string -warn-error +a #Deprication returns with ocaml 4.03 -WARNINGS=-w +a-4-9-27 +WARNINGS=-w +a-4-9-27-42 extraction/%.cmx: WARNINGS +=-w -20-27-32..34-39-41-44..45-60-67 extraction/%.cmo: WARNINGS +=-w -20-27-32..34-39-41-44..45-60-67 -- cgit