Create cbuild.sh

The cbuild.sh file a bash script for create an executable of kickthemout with cython
This commit is contained in:
Urgau 2017-01-20 18:37:55 +01:00 committed by GitHub
parent 3442a2f825
commit 18dd788939

19
cbuild.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
#Copyright Loïc Branstett 2017 MIT License
if ! [ -x "$(command -v cython2)" ]; then
echo 'Cython2 is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v gcc)" ]; then
echo 'Gcc is not installed.' >&2
exit 1
fi
echo "Making the C file ...";
cython2 --embed kickthemout.py
echo "Compling C file to executable ..."
gcc $CFLAGS -I/usr/include/python2.7 -o kickthemout kickthemout.c -lpython2.7 -lpthread -lm -lutil -ldl
echo "Compile finish ! You can launch kickthemout with ./kickthemout"