over/core/build.sh

22 lines
531 B
Bash
Executable file

#! /bin/zsh
# encoding: utf-8
setopt extendedglob
function die() {
echo "\n\n>>> Failed during ${1}, aborting."
exit 1
}
CFLAGS=(-Wall -pedantic -std=c99 -fPIC)
LFLAGS=(-shared)
echo "- translating from Python to C"
cython -3 cython_types.pyx -o cython_types.c || die "translating"
echo "- compiling and linking"
gcc $CFLAGS -I/usr/include/python3.4 -pthread -c cython_types.c || die "compilation"
gcc $LFLAGS -L/usr/lib -lpython3.4 cython_types.o -o cython_types.so || die "linking"
rm -f cython_types.{c,o}
echo "- done"