SRCS= Mathmatics.cpp\
		fill_matrix.cpp\
		qpalma_dp.cpp\
		result_align.cpp\
		debug_tools.cpp\
		penalty_info.cpp\
		print_align.cpp\
		io.cpp

HDRS= Mathmatics.h\
		common.h\
		config.h\
		debug_tools.h\
		fill_matrix.h\
		io.h\
		penalty_info.h\
		qpalma_dp.h

OBJS = $(SRCS:%.cpp=%.o)

PY_INCL=`python-config --cflags`
PY_LIBS=`python-config --ldflags`

CXXFLAGS=-Wall -std=c++98 -ggdb -O9 -fPIC $(PY_INCL)

IF=QPalmaDP

all: $(OBJS) $(HDRS)
	@ echo $(PY_INCL) $(PY_LIBS)
	swig -c++ -python ${IF}.i
	g++ $(CXXFLAGS) -c ${IF}_wrap.cxx -o ${IF}_wrap.o
	g++ $(CXXFLAGS) -shared $(PY_LIBS) $(OBJS) ${IF}_wrap.o -o _${IF}.so -fPIC -dynamiclib
	python -c "import ${IF}" && echo "DynProg was compiled sucessfully!"

clean:
	@ rm *.o *.so *.cxx ${IF}.py ${IF}.pyc
