forked from GLYCAM-Web/gems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
executable file
·64 lines (63 loc) · 1.62 KB
/
make.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
MOOD="$1"
TARGET_MAKE_FILE="Makefile-main"
echo $TARGET_MAKE_FILE
echo $MOOD
if [ -z "$PYTHON_HOME" ] ; then
echo "PYTHON_HOME is not set. Attempting to set it to /usr/include/python2.7 ..."
if [ -e "/usr/include/python2.7/Python.h" ] ; then
export PYTHON_HOME="/usr/include/python2.7"
echo "PYTHON_HOME has been set to /usr/include/python2.7."
else
echo "Cannot automatically set PYTHON_HOME environment variable. Exiting."
echo "Your PYTHON_HOME should be set to the location of Python.h for your python2.7 installation."
exit 1
fi
fi
cd gmml
if [ -f $TARGET_MAKE_FILE ]; then
if [ "$MOOD" == "Qt" ]; then
echo "Compile compatible with Qt"
make distclean
rm -rf gmml.pro*
qmake -project -t lib -o gmml.pro "OBJECTS_DIR = build" "DESTDIR = bin"
qmake -o
make
else
echo "Qt independent compilation"
make -f $TARGET_MAKE_FILE distclean
rm -rf gmml.pro*
make -f $TARGET_MAKE_FILE
fi
else
if [ "$MOOD" == "Qt" ]; then
make distclean
rm -rf gmml.pro*
qmake -project -t lib -o gmml.pro "OBJECTS_DIR = build" "DESTDIR = bin"
qmake -o
make
else
echo "Qt independent make file does not exist"
fi
fi
cd ..
if [ -f "gmml.i" ]; then
swig -c++ -python gmml.i
else
echo "Interface file for swig does not exist"
fi
PYTHON_FILE="$PYTHON_HOME/Python.h"
if [ -f $PYTHON_FILE ]; then
if [ -f "gmml_wrap.cxx" ]; then
g++ -O3 -fPIC -c gmml_wrap.cxx -I"$PYTHON_HOME"
else
echo "gmml_wrap.cxx does not exist"
fi
else
echo "PYTHON_HOME variable has not been set"
fi
if [ -f "gmml_wrap.o" ]; then
g++ -shared gmml/build/*.o gmml_wrap.o -o _gmml.so
else
echo "gmml has not been compiled correctly"
fi