# include definitions of Diffpack Makefile variables:

# SWIG-specific make variables:
LDPATH = -L$(PCCR)/lib
LIBS    =  -lMatrixFactory -lFiber `dolfin-config --libs`

SWIG       = swig
SWIGOPT    = $(shell swigopts.sh -p)
CXX        = `dolfin-config --compiler`
CFLAGS     = `dolfin-config --cflags`  -I$(shell pyinc.py) -fPIC -O3  -c -I.. -I$(PCCR)/include
LDFLAGS    = -fPIC 
TARGET     = MatrixFactory
INTERFACE  = $(TARGET).i

all:: wrapper module 

wrapper::
	swig $(SWIGOPT) $(INTERFACE)

module::
	g++ $(CFLAGS)  -pg $(TARGET)_wrap.cxx 
	g++ -shared $(TARGET)_wrap.o $(LDFLAGS) $(LDPATH) $(LIBS) -o _$(TARGET).so

clean::
	rm -f *_wrap* *.so *.o $(OBJ_FILES)  *~ *.pyc $(TARGET).py

install: all 
	cp _*so $(TARGET).py  $(PCCR)/lib/.
