From dda5c03e77ab81e308969499c3c20133a1edcede Mon Sep 17 00:00:00 2001
From: Allan Blanchard <allan.blanchard@cea.fr>
Date: Wed, 1 Jun 2022 16:25:29 +0200
Subject: [PATCH] [dune] add release mode in Makefile

---
 Makefile               | 9 ++++++++-
 share/Makefile.testing | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 962837b42d8..39951f04649 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,13 @@ $(error \
   "You should run ./configure first (or autoconf if there is no configure)")
 endif
 
+RELEASE?=no
+ifeq ($(RELEASE),yes)
+DUNE_BUILD_OPTS=--release
+else
+DUNE_BUILD_OPTS=
+endif
+
 ###################
 # Frama-C Version #
 ###################
@@ -43,7 +50,7 @@ VERSION_CODENAME:=$(shell $(CAT) VERSION_CODENAME)
 .PHONY: all
 
 all: config.sed
-	dune build @install
+	dune build $(DUNE_BUILD_OPTS) @install
 
 ifeq ($(HAS_DOT),yes)
 OPTDOT=Some \"$(DOT)\"
diff --git a/share/Makefile.testing b/share/Makefile.testing
index d5302120333..352d58e1b5e 100644
--- a/share/Makefile.testing
+++ b/share/Makefile.testing
@@ -57,7 +57,7 @@ PTESTS=frama-c-ptests
 else
 
 # PTESTS is internal
-PTESTS=dune exec --root ptests -- frama-c-ptests
+PTESTS=dune exec $(DUNE_BUILD_OPTS) --root ptests -- frama-c-ptests
 #PTESTS=dune exec --root ptests -- frama-c-ptests -v
 
 # Note: the public name of ptest.exe is frama-c-ptests
@@ -83,7 +83,7 @@ WTESTS=frama-c-wtests
 else
 
 # WTESTS is internal to Frama-C
-WTESTS=dune exec --root ptests -- frama-c-wtests
+WTESTS=dune exec $(DUNE_BUILD_OPTS) --root ptests -- frama-c-wtests
 
 # Note: the public name of wtest.exe is frama-c-wtests
 $(FRAMAC_WTESTS): ptests/wtests.ml
-- 
GitLab