Commit a9c2dc5b authored by POTTIER Francois's avatar POTTIER Francois

A more modern, gitlab-based release process.

parent 6e324062
This diff is collapsed.
......@@ -50,8 +50,8 @@ bindir := $(PREFIX)/bin
docdir := $(PREFIX)/share/doc/menhir
libdir := $(PREFIX)/share/menhir
mandir := $(PREFIX)/share/man/man1
MANS := menhir.1
DOCS := manual.pdf manual.html manual*.png demos
MANS := doc/menhir.1
DOCS := doc/manual.pdf doc/manual.html doc/manual*.png demos
MLYLIB := src/standard.mly
# ----------------------------------------------------------------------------
......@@ -195,12 +195,10 @@ install:
install -m 644 $(patsubst %,$(BUILDDIR)/%,$(MENHIRLIB)) $(libdir) ; \
install -m 644 $(patsubst %,$(SDKDIR)/%,$(MENHIRSDK)) $(libdir) ; \
fi
# Install the documentation, if it has been built.
if [ -f manual.pdf ] ; then \
mkdir -p $(docdir) $(mandir) && \
cp -r $(DOCS) $(docdir) && \
cp -r $(MANS) $(mandir) ; \
fi
# Install the documentation.
mkdir -p $(docdir) $(mandir)
cp -r $(DOCS) $(docdir)
cp -r $(MANS) $(mandir)
uninstall:
@if `$(bindir)/menhir$(EXE) --suggest-ocamlfind` ; then \
......
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# This script checks that a Menhir tarball can be compiled and installed.
# The command line argument should be the tarball's name without .tar.gz.
PACKAGE="$1"
TARBALL=$PACKAGE.tar.gz
# Some of the demos assume Menhir has been installed using ocamlfind, so that
# is what we do. For this reason, we must first check that ocamlfind does not
# already have some version of menhirLib and menhirSdk.
# We could also create a fresh opam switch, but that would be time-consuming.
if ocamlfind query menhirLib >/dev/null 2>/dev/null ; then
if opam list -i menhir 2>/dev/null | grep -v -e "^#" | grep menhir ; then
echo "Warning: menhir is already installed." ;
read -p "Can I remove it [Enter/^C]?" -n 1 -r ;
opam remove menhir ;
else
echo "Warning: menhirLib is already installed." ;
read -p "Can I remove it [Enter/^C]?" -n 1 -r ;
ocamlfind remove menhirLib ;
ocamlfind remove menhirSdk || true ;
fi ;
fi
# Create a temporary directory; extract, build, and install the package into
# it; build the demos using the installed binary.
TEMPDIR=`mktemp -d /tmp/menhir-test.XXXXXX`
INSTALL=$TEMPDIR/install
cp $TARBALL $TEMPDIR
echo " * Extracting. "
(cd $TEMPDIR && tar xfz $TARBALL)
echo " * Compiling and installing."
mkdir $INSTALL
(cd $TEMPDIR/$PACKAGE &&
make PREFIX=$INSTALL USE_OCAMLFIND=true &&
make PREFIX=$INSTALL USE_OCAMLFIND=true install
) > $TEMPDIR/install.log 2>&1 || (cat $TEMPDIR/install.log; exit 1)
echo " * Building the demos."
(cd $TEMPDIR/$PACKAGE &&
make MENHIR=$INSTALL/bin/menhir -C demos
) > $TEMPDIR/demos.log 2>&1 || (cat $TEMPDIR/demos.log; exit 1)
echo " * Uninstalling."
(cd $TEMPDIR/$PACKAGE &&
make PREFIX=$INSTALL USE_OCAMLFIND=true uninstall
) > $TEMPDIR/uninstall.log 2>&1 || (cat $TEMPDIR/uninstall.log; exit 1)
rm -rf $TEMPDIR
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