##makefile to build spres class library
##configure options to consider are:
##
##  -DPARALLEL      : set this if invoking omp parallelisation
##  -fomp           : this flag is also required for omp.
##  -DMAX_MEM_BYTES : set this to some large number; if you find that your trajectory fragments are overflowing memory
##                    then it is possible to save states using memory over this value to disc instead.
##                    for most uses, you shouldn't have to worry about this.
##  -DMAX_SAMPLES   : use this to put a ceiling on the number of runs from each bin.

PARALLEL_FLAGS = -DPARALLEL_OMP -fopenmp

FLAGS = -O4 -Wall -DMAX_SAMPLES=500 -DSTRING_MEM -DMAX_MEM_BYTES=180000000000 

OBJECTS  = spres.o spres_2.o transitionMatrix.o shotFiles.o parseShotFileNames.o spresLoop.o writeDerivedData.o

INCLUDES = simulation.h spres.h

CC       = g++ 


# -------------------------

spres : $(OBJECTS) $(INCLUDES)
	ar -curs ../lib/libspres.a $(OBJECTS) 

%.o : %.C $(INCLUDES)
	$(CC) $(FLAGS) $(PARALLEL_FLAGS) -c $< -o $@   

doc :  
	doxygen ../docs/doxygen.conf
	$(MAKE) -C ../docs/latex

clean: 
	rm -f *.o *~ \#* ../test/log \
            ../test/shortTest.log ../test/shortTest.etj

clobber: clean
	rm -Rf ../lib/*.a ../docs/html/* ../docs/latex/* ../docs/*~ ../docs/\#*  
