Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit adb82cce authored by POTTIER Francois's avatar POTTIER Francois
Browse files

GNUmakefile: [make check] installs Menhir using ocamlfind,

so that the demos can be built properly, and uninstalls it
afterwards. Also, it checks that MenhirLib is not initially
installed already.
parent 3ff2f765
...@@ -138,13 +138,26 @@ check: ...@@ -138,13 +138,26 @@ check:
# Create a temporary directory; extract, build, and install the # Create a temporary directory; extract, build, and install the
# package into it; build the demos and run the test suite using # package into it; build the demos and run the test suite using
# the installed binary. # the installed binary.
# Some of the demos assume Menhir has been installed using ocamlfind,
# so that is what we do. For this reason, we must check first that
# ocamlfind does not already have some version of menhirLib.
@ if ocamlfind query menhirLib >/dev/null 2>/dev/null ; then \
echo "Error: menhirLib is already installed." ; \
echo "Please remove it first by running this command:" ; \
if opam list -i menhir >/dev/null ; then \
echo " opam remove menhir" ; \
else \
echo " ocamlfind remove menhirLib" ; \
fi ; \
exit 1 ; \
fi
@ TEMPDIR=`mktemp -d /tmp/menhir-test.XXXXXX` && { \ @ TEMPDIR=`mktemp -d /tmp/menhir-test.XXXXXX` && { \
echo " * Extracting. " && \ echo " * Extracting. " && \
(cd $$TEMPDIR && tar xfz $(TARBALL)) && \ (cd $$TEMPDIR && tar xfz $(TARBALL)) && \
echo " * Compiling and installing." && \ echo " * Compiling and installing." && \
mkdir $$TEMPDIR/install && \ mkdir $$TEMPDIR/install && \
(cd $$TEMPDIR/$(PACKAGE) \ (cd $$TEMPDIR/$(PACKAGE) \
&& make PREFIX=$$TEMPDIR/install USE_OCAMLFIND=false all install \ && make PREFIX=$$TEMPDIR/install USE_OCAMLFIND=true all install \
) > $$TEMPDIR/install.log 2>&1 \ ) > $$TEMPDIR/install.log 2>&1 \
|| (cat $$TEMPDIR/install.log; exit 1) && \ || (cat $$TEMPDIR/install.log; exit 1) && \
echo " * Building the demos." && \ echo " * Building the demos." && \
...@@ -155,6 +168,11 @@ check: ...@@ -155,6 +168,11 @@ check:
echo " * Running the test suite." && \ echo " * Running the test suite." && \
$(MAKE) MENHIR=$$TEMPDIR/install/bin/menhir test > $$TEMPDIR/test.log 2>&1 \ $(MAKE) MENHIR=$$TEMPDIR/install/bin/menhir test > $$TEMPDIR/test.log 2>&1 \
|| (cat $$TEMPDIR/test.log; exit 1) && \ || (cat $$TEMPDIR/test.log; exit 1) && \
echo " * Uninstalling." && \
(cd $$TEMPDIR/$(PACKAGE) \
&& make PREFIX=$$TEMPDIR/install USE_OCAMLFIND=true uninstall \
) > $$TEMPDIR/uninstall.log 2>&1 \
|| (cat $$TEMPDIR/uninstall.log; exit 1) && \
rm -fr $$TEMPDIR ; } rm -fr $$TEMPDIR ; }
@ echo "-> Package $(PACKAGE) seems ready for distribution!" @ echo "-> Package $(PACKAGE) seems ready for distribution!"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment