-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
76 lines (60 loc) · 1.49 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
MPICOMPILER = mpic++
OPT = -O3 -std=c++11
MPI_OPT = -O3 -std=c++11
SRC_FOLDER = src
LIB =
FILES = newReader.cpp \
WangularSpectrum.cpp \
WenergySpectrum.cpp \
WsliceDaBinario.cpp \
WspacialSpectrum.cpp \
lightReader.cpp \
frogReader.cpp \
titan.cpp \
titan2.cpp \
clusters.cpp \
randomballs.cpp \
multiFrogReader.cpp
MPIFILES = MPItitan.cpp \
MPIpicker.cpp
DEPFILES = utilities-tools.cpp
SRC = $(addprefix $(SRC_FOLDER)/, $(FILES))
MPI_SRC = $(addprefix $(SRC_FOLDER)/, $(MPIFILES))
DEP_SRC = $(addprefix $(SRC_FOLDER)/, $(DEPFILES))
MPIEXES = $(addsuffix .mpi, $(basename $(MPIFILES)))
EXES = $(addsuffix .exe, $(basename $(FILES)))
DEPS = $(addsuffix .o, $(basename $(DEPFILES)))
all : $(DEPS)
all : $(EXES)
all : $(MPIEXES)
boost : OPT = -O3 -DUSE_BOOST
boost : LIB = -lboost_random
boost : $(DEPS)
boost : $(EXES)
boost : $(MPIEXES)
fermi : OPT = -O3 -std=c++0x
fermi : MPICOMPILER = mpixlcxx
fermi : MPI_OPT = -qipa=partition=large -qarch=qp -qtune=qp -qmaxmem=-1
fermi : $(DEPS)
fermi : $(EXES)
fermi : $(MPIEXES)
cnaf : OPT = -O3 -std=c++0x
cnaf : MPI_OPT = -O3 -std=c++0x
cnaf : $(DEPS)
cnaf : $(EXES)
cnaf : $(MPIEXES)
debug : OPT = -O0 -g -std=c++0x
debug : MPI_OPT = -O0 -g -std=c++0x
debug : $(DEPS)
debug : $(EXES)
debug : $(MPIEXES)
%.o: $(SRC_FOLDER)/%.cpp
$(CXX) $(OPT) -c -o $@ $<
%.exe: $(SRC_FOLDER)/%.cpp
$(CXX) $(OPT) -o $@ $(DEPS) $< $(LIB)
%.mpi: $(SRC_FOLDER)/%.cpp
$(MPICOMPILER) $(MPI_OPT) -o $@ $< $(LIB)
clean:
rm -f $(DEPS)
cleanall: clean
rm -f $(EXES) $(MPIEXES)