lean4-htt/tests/ir/lirc
Leonardo de Moura b0a4066695 test(tests/ir): add basic script for compiling IR definitions
The support libraries are currently hard coded.
2018-05-14 17:27:05 -07:00

28 lines
757 B
Bash
Executable file

#!/usr/bin/env bash
unamestr=`uname`
if [[ "$unamestr" == 'Darwin' ]]; then
# OSX
if command -v greadlink >/dev/null 2>&1; then
# macOS readlink doesn't support -f option
READLINK=greadlink
else
echo "OSX 'readlink' command does not support option '-f', please install 'greadlink'. If you use 'brew', you can install 'greadlink' using 'brew install coreutils'"
exit 1
fi
else
READLINK=readlink
fi
leandir=$(dirname $($READLINK -f $0))/../../
leandir=$($READLINK -f $leandir)
if [ "${1: -3}" != ".ir" ]
then
echo "Error, `.ir` file expected"
exit 1
fi
exe="${1%%.*}"
$leandir/bin/lean --run lirc.lean $1 && g++ -o $exe -I../../src -L../../bin -std=c++11 $1.cpp -lleanruntime -lgmp -ldl -ljemalloc