RM := rm -rf

#this is really nothing but for testing the capabilities of the copper library
DELTA_SRC = main_delta.cpp
DELTA_OBJ = main_delta.o
DELTA_DEP = main_delta.d

#this should be the basic copper library sources, objects and deps
CPP_SRCS += \
./utils.cpp \
./node.cpp \
./tree.cpp \
./tree_reader.cpp \
./tree_utils.cpp \
./bd_sim.cpp \
./delta.cpp

CPP_OBJS += \
./utils.o \
./node.o \
./tree.o \
./tree_reader.o \
./tree_utils.o \
./bd_sim.o \
./delta.o

CPP_DEPS += \
./utils.d \
./node.d \
./tree.d \
./tree_reader.d \
./tree_utils.d \
./bd_sim.d \
./delta.d

#REQUIRES THE GSL AND  libgmpxx and libgmp libraries for optimization and large number overflow errors
###########
# loses about 3x speed
# if 64 bit GSL try CPPFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure
# need to install gmp (with ./configure --enable-cxx) and mpfr and gmpfrxx
#######
CPP_LIBS = -lgsl -lgslcblas -lm -lgmpxx -lgmp -lmpfr -lgmpfrxx -fopenmp

OPT_FLAGS += \
-O3 -ffast-math -ftree-vectorize -g3 -Wall -fopenmp
#-g -O0

# Each subdirectory must supply rules for building sources it contributes
%.o: ./%.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: GCC C++ Compiler'
	g++ $(OPT_FLAGS) -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o  "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '

# All Target
all: phyx_delta

phyx_delta: $(CPP_OBJS) $(DELTA_OBJ) 
	@echo 'Building target: $@'
	@echo 'Invoking: GCC C++ Linker'
	g++ -o "phyx_delta" -L./gmpfrxx/ $(DELTA_OBJ) $(CPP_OBJS) $(CPP_LIBS)
	@echo ' '

# Other Targets
clean:
	-$(RM) *.o *.d phyx_delta
	-@echo ' '

