SHELL=/bin/sh 
include /home/users/ntrebon/apps/cca/tau2/include/Makefile

MPI_HOME=/home/users/ntrebon/apps/ccaffeine/mpi
TAU_MPI_INCLUDE = -I$(MPI_HOME)/include
TAU_MPI_LIBS = -L$(MPI_HOME)/lib -lmpich
#Here is the location where the ports are defined
PORTS_INCLUDE = -I/home/users/ntrebon/apps/cca/cfrfs/CFRFS_Ports

# We need to know where CCA is -- this is system specific.
# Customarily it should be /usr/local/cca-spec. 
# In ben's tree, it's $(HOME)/work/caff/cca-spec
CCAFE_ROOT=/home/users/ntrebon/apps/neocca/install/share/ccafe-0.5.0/
CCA_SPEC_CLASSIC=/home/users/ntrebon/apps/neocca/install/share/cca-spec-classic-0.5.6/
CCAFE_HOME=/home/users/ntrebon/apps/neocca/build/dccafe/cxx
DCCAFE_LIBS = /home/users/ntrebon/apps/neocca/install/lib/ccafe-0.5.2/

APPLIB = -L$(DCCAFE_LIBS) -Wl,-rpath,$(DCCAFE_LIBS)/ -lccafeCore

include $(CCAFE_HOME)/Makefile.Rules
# Get the vars we need to build with CCA by including its
# public build variable definitions.
include $(CCA_SPEC_CLASSIC)/MakeIncl.CCA_Component

#--------------------- End of external package settings  ---------------------

CXX = g++ -Wall

SOURCES = CallPathNode.cc Record_CCA.cc MasterMind_CCA.cc 

OBJECTS = CallPathNode.o Record_CCA.o MasterMind_CCA.o

all:	libMasterMind

install:	libMasterMind
	cp libMasterMind_CCA.so ../lib/.

CallPathNode.o:	CallPathNode.cc
	$(CXX) -c -g -fPIC -I. $<

Record_CCA.o:	Record_CCA.cc
	$(CXX) -c -g -fPIC -I.. $(CCA_INC) $(NEOCCA_INC) -I. $< $(TAU_MPI_INCLUDE) $(PORTS_INCLUDE)

MasterMind_CCA.o:	MasterMind_CCA.cc
	$(CXX) -c -g -fPIC -I.. $(CCA_INC) $(NEOCCA_INC) -I. $< $(TAU_MPI_INCLUDE) $(PORTS_INCLUDE)

libMasterMind: MasterMind_CCA.o Record_CCA.o CallPathNode.o
	$(CXX) -shared -o libMasterMind_CCA.so MasterMind_CCA.o Record_CCA.o CallPathNode.o $(TAU_MPI_LIBS) $(APPLIB)

.cc.o: $(SOURCES)
	$(CXX) -c -g -fPIC -I.. $(CCA_INC) $(NEOCCA_INC) -I. $< 

clean:
	-$(RM) *.a *.i *.x *.so *.out *.exe *.o *.log *~ profile.* dump.* pErr? pOut? 

