Files
langkit/scripts/manage.sh
Raphaël AMIARD 3ae12509e3 Minor: clean build space for lib*lang before building
This ensures that if the version of GNAT has changed, we won't get an
uncaught exception from out of date libraries.
2020-03-12 14:42:52 +01:00

51 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
LANGKIT_ROOT=`dirname $0`"/.."
cd "$LANGKIT_ROOT"
make () {
# We need to clean the build space of the langkit libraries we depend
# upon before we run langkit again. Else, if we installed a newer version
# of GNAT since those libraries were built, what will happen is that:
#
# 1. Langkit will try loading them.
# 2. This will cause an uncaught exception trying to load some so from the
# compiler, preventing langkit to run.
# 3. Langkit cannot be used to recompile libpythonlang and liblktlang to
# newer versions.
rm contrib/python/build -rf
rm contrib/lkt/build -rf
(
cd "contrib/python"
./manage.py make -P
)
(
cd "contrib/lkt"
rm build -rf
./manage.py make -P
)
}
setenv () {
(
cd "contrib/python"
./manage.py setenv
)
(
cd "contrib/lkt"
./manage.py setenv
)
}
if [ "$1" = "make" ]; then
make
elif [ "$1" = "setenv" ]; then
setenv
else
echo "Unknown command : $1"
exit 1
fi