#set default architecture, can be overridden from the compile line
ARCH = $(VLASIATOR_ARCH)
include ../../MAKE/Makefile.${ARCH}

#set FP precision to SP (single) or DP (double)
FP_PRECISION = DP

#Set floating point precision for distribution function to SPF (single) or DPF (double)
DISTRIBUTION_FP_PRECISION = DPF

#is profiling on?
CXXFLAGS += -DPROFILE

#Add -DNDEBUG to turn debugging off. If debugging is enabled performance will degrade significantly
CXXFLAGS += -DNDEBUG

#Set order of semilag solver in velocity space acceleration
#  ACC_SEMILAG_PLM 	2nd order	
#  ACC_SEMILAG_PPM	3rd order (use this one unless you are testing)
#  ACC_SEMILAG_PQM      5th order (in development)
CXXFLAGS += -DACC_SEMILAG_PLM 
#define USE_AGNER_VECTORCLASS to use an external vector class that is used in some of the solvers
#If not defined a slower but portable implementation is used, as the external one only supports 
#Linux & x86 processors  
CXXFLAGS += -DUSE_AGNER_VECTORCLASS



#//////////////////////////////////////////////////////
# The rest of this file users shouldn't need to change
#//////////////////////////////////////////////////////

#will need profiler in most places..
CXXFLAGS += ${INC_PROFILE} 

#define precision
CXXFLAGS += -D${FP_PRECISION} -D${DISTRIBUTION_FP_PRECISION}


default: all

all: map_test map_test_3d map_test_3d_openmp

# Compile directory:
INSTALL = $(CURDIR)

# Collect libraries into single variable:
LIBS += ${LIB_PROFILE}

# Define common dependencies
DEPS_COMMON = ../../common.h ../../definitions.h 


help:
	@echo ''
	@echo 'make c(lean)             delete all generated files'
	@echo 'make                     make map_test'

# remove data generated by simulation

clean:
	rm -rf *.o *~ $(EXE)

# Rules for making each object file needed by the executable

map_test.o: map_test.cpp 
	${CMP} ${CXXFLAGS} ${FLAG_OPENMP} ${MATHFLAGS} ${FLAGS}  -c map_test.cpp   ${INC_PROFILE}  ${INC_VECTORCLASS} 

# Make executable
map_test: map_test.o
	$(LNK) ${LDFLAGS} -o map_test map_test.o $(LIBS)

map_test_3d.o: map_test_3d.cpp 
	${CMP} ${CXXFLAGS} ${FLAG_OPENMP} ${MATHFLAGS} ${FLAGS}  -c map_test_3d.cpp   ${INC_PROFILE}  ${INC_VECTORCLASS} 

# Make executable
map_test_3d: map_test_3d.o
	$(LNK) ${LDFLAGS} -o map_test_3d map_test_3d.o $(LIBS)




map_test_3d_openmp.o: map_test_3d_openmp.cpp 
	${CMP} ${CXXFLAGS} ${FLAG_OPENMP} ${MATHFLAGS} ${FLAGS}  -c map_test_3d_openmp.cpp   ${INC_PROFILE}  ${INC_VECTORCLASS} 

# Make executable
map_test_3d_openmp: map_test_3d_openmp.o
	$(LNK) ${LDFLAGS} -o map_test_3d_openmp map_test_3d_openmp.o $(LIBS) $(LIB_MPI)


