PROJ=ParaParser

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

CXXFLAGS=-Wall -Wshadow -std=c++98 -O3 -fPIC $(PY_INCL)
CFLAGS=-Wall -Wshadow 

SRCS= ParaParser.cpp

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

all: $(OBJS)
	@ echo "Building ParaParser module"
	swig -c++ -python ${PROJ}.i
	gcc $(CFLAGS) -c getline.c -o getline.o
	g++ $(CXXFLAGS) -c ${PROJ}_wrap.cxx -o ${PROJ}_wrap.o
	g++ $(CXXFLAGS) -shared $(PY_LIBS) $(OBJS) ${PROJ}_wrap.o getline.o -o _${PROJ}.so -dynamiclib
	python -c "import ${PROJ}" && echo "Creation of ParaParser module was successful!"

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