From c6be844b5dd75bdc385308b7afde5d4b62042f70 Mon Sep 17 00:00:00 2001 From: Andre Maroneze <andre.maroneze@cea.fr> Date: Mon, 20 Feb 2023 09:36:33 +0100 Subject: [PATCH] [dev] use DUNE_WS variable for compiling/installing dune-workspaces --- Makefile | 8 +++++++- share/Makefile.installation | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ea6e6868b09..97057c87d67 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,12 @@ FRAMAC_LINTCK_SRC:=tools/lint .PHONY: all +ifneq (${DUNE_WS},) + WORKSPACE_OPT:=--workspace dev/dune-workspace.${DUNE_WS} +else + WORKSPACE_OPT:= +endif + all:: ifeq (${FRAMAC_DEVELOPER},yes) dune build --no-print-directory --root ${FRAMAC_LINTCK_SRC} @@ -53,7 +59,7 @@ ifneq ($(DISABLED_PLUGINS),) rm -rf _build .merlin ./dev/disable-plugins.sh ${DISABLED_PLUGINS} endif - dune build $(DUNE_BUILD_OPTS) @install + dune build ${WORKSPACE_OPT} ${DUNE_BUILD_OPTS} @install clean:: purge-tests # to be done before a "dune" command ifeq (${FRAMAC_DEVELOPER},yes) diff --git a/share/Makefile.installation b/share/Makefile.installation index 8e10270d351..d3ed2da27b2 100644 --- a/share/Makefile.installation +++ b/share/Makefile.installation @@ -52,6 +52,12 @@ endif .PHONY: install uninstall +ifneq (${DUNE_WS},) + WORKSPACE_OPT:=--workspace dev/dune-workspace.${DUNE_WS} +else + WORKSPACE_OPT:= +endif + ifneq ($(INSTALL_TARGET),) INSTALL_TARGET:="$(INSTALL_TARGET) " endif @@ -68,12 +74,12 @@ endif ifeq ($(PREFIX),$(OPAM_SWITCH_PREFIX)) @echo "Installing $(INSTALL_TARGET)to current Opam switch" @printf " Copying and relocating files..." - dune install --root . ${MANDIR_OPT} 2> /dev/null + dune install ${WORKSPACE_OPT} --root . ${MANDIR_OPT} 2> /dev/null @echo " (done)" else @echo "Installing $(INSTALL_TARGET)to ${PREFIX}" @printf " Copying and relocating files..." - dune install --root . --prefix ${PREFIX} ${MANDIR_OPT} 2> /dev/null + dune install ${WORKSPACE_OPT} --root . --prefix ${PREFIX} ${MANDIR_OPT} 2> /dev/null @echo " (done)" @echo 'DO NOT FORGET TO EXPAND YOUR OCAMLPATH VARIABLE:' @echo ' export OCAMLPATH="${PREFIX}/lib:$$OCAMLPATH"' -- GitLab