summaryrefslogtreecommitdiff
path: root/compile_debug.sh
blob: 3ea31882b6d80428d4e812216ea0e82ff085d9ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash

ME=compile_debug

if (($# == 1 ))
then
    PREFIX=${1/%\//}
else
    PREFIX="/usr/local/ouroboros"
fi

BUILDDIR=build
DEBUGDIR=debug

echo "$ME: Prefix is $PREFIX"

echo "$ME: Build directory will be '$BUILDDIR'"
if test -n "$BUILDDIR" ; then
    mkdir -p $BUILDDIR || {
        echo "$ME: Cannot create directory '$BUILDDIR'"
    }
fi
cd $BUILDDIR || exit 1

echo "$ME: Debug directory will be '$DEBUGDIR'"
if test -n "$DEBUGDIR" ; then
    mkdir -p $DEBUGDIR || {
        echo "$ME: Cannot create directory '$DEBUGDIR'"
    }
fi
cd $DEBUGDIR || exit 1

cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Debug ../..

make && make check