+ update makefiles to fetch automatically valid Python includes and libs
[qpalma.git] / DynProg / Makefile
1 SRCS= Mathmatics.cpp\
2 fill_matrix.cpp\
3 qpalma_dp.cpp\
4 result_align.cpp\
5 debug_tools.cpp\
6 penalty_info.cpp\
7 print_align.cpp\
8 io.cpp
9
10 HDRS= Mathmatics.h\
11 common.h\
12 config.h\
13 debug_tools.h\
14 fill_matrix.h\
15 io.h\
16 penalty_info.h\
17 qpalma_dp.h
18
19 OBJS = $(SRCS:%.cpp=%.o)
20
21 PY_INCL=`python-config --cflags`
22 PY_LIBS=`python-config --ldflags`
23
24 CXXFLAGS=-Wall -std=c++98 -ggdb -O3 -fPIC $(PY_INCL)
25
26 IF=QPalmaDP
27
28 all: $(OBJS) $(HDRS)
29 @ echo $(PY_INCL) $(PY_LIBS)
30 @ swig -c++ -python ${IF}.i
31 @ g++ $(CXXFLAGS) -c ${IF}_wrap.cxx -o ${IF}_wrap.o
32 @ g++ $(CXXFLAGS) -shared $(PY_LIBS) $(OBJS) ${IF}_wrap.o -o _${IF}.so
33 @ python -c "import ${IF}"
34
35 clean:
36 @ rm *.o *.so *.cxx ${IF}.py ${IF}.pyc