#!smake

# g++-mp-15 (MacPorts GCC) is required for -fopenmp on this Mac: the
# system /usr/bin/g++ is Apple Clang and rejects -fopenmp outright.
CC		= /opt/local/bin/g++-mp-15

CCOPT		= -c -O3 -march=native -funroll-loops -flto -fopenmp -I. -Wno-deprecated

MPI_DIR         = /opt/local

INCLUDE_PATH    = -I. -I$(MPI_DIR)/include
LIB_PATH        = -L. -L$(MPI_DIR)/lib

#####################################################################

# code principal
main : main.o Array.o
	$(CC) -flto -fopenmp $(INCLUDE_PATH) -o  main main.o Array.o $(LIB_PATH) -lfftw3 -lm

#######################################################################
# compilation du fichier test

main.o : main.cpp
	   $(CC) $(CCOPT) $(INCLUDE_PATH) main.cpp

# compilation du fichier array

Array.o : Array.cpp
	   $(CC) $(CCOPT) $(INCLUDE_PATH) Array.cpp

clean : 
	\rm -rf *.o *~ main 
menage : 
	\rm -rf *.out f.* b.* m.* fe.* fi.*
