CXX = mpicxx
CPP = mpicxx
CC = mpicc
#CXX = vtcxx -vt:cxx mpicxx -vt:inst manual
#CC = vtcc -vt:cc mpicc -vt:inst manual
#CPP = vtcxx -vt:cxx mpicxx -vt:inst manual
AR = ar

CXXFLAGS = -fPIC -DMPICH_IGNORE_CXX_SEEK -DVTRACE -DVTRACE_PTHREAD -O3 -Wall

OBJS = steereoObject.o steereoLogger.o steereoSocketCommunicator.o steereoSteeringBase.o steereoSimSteering.o steereoCommand.o commandIDGenerator.o steereoCommunicator.o steereoCommandQueue.o steereoParameterParser.o request_xdr.o steereoStream.o point3D.o cuboid.o steereoSingleConnection.o steereoConnection.o steereoCompression.o steereoDeltaCompression.o steereoOctTreeCompression.o steereoSingleSocketConnection.o steereoClientSteering.o steeringMethodsCommand.o steerParameterCommand.o steerParameterClient.o pauseCommand.o commandLoader.o steereoWrapper.o setCouplingInfoCommand.o couplingSteering.o waitForSynchronizationCommand.o steereoIntraCommunicator.o steereoSequentialIntraCommunicator.o getSteeringPartitionsCommand.o steereoMPICommunicator.o singleMPIConnection.o steereoMPIIntraCommunicator.o steereoCouplingClient.o steereoCouplingSim.o steereoTiming.o

INC = 
LIBS = -lSteereo -L../Steereo/src

TARGET = libSteereo.so

%.o: %.cpp
	$(CXX) $(INC) $(CXXFLAGS) -c $< -o $@

%.o: %.c
	$(CC) $(INC) $(CXXFLAGS) -c $< -o $@

$(TARGET):	$(OBJS)
	$(CPP) $(CXXFLAGS) -fPIC -shared -Wl,-soname,$@ -o $@ $^

static: $(OBJS)
	$(AR) rcs libSteereo-static.a $(OBJS)

all:	$(TARGET)

clean:
	rm -f $(OBJS) $(TARGET) libSteereo-static.a