-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
54 lines (38 loc) · 1.22 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
CXX ?= g++
LIKWID ?= off
FLAGS =
INCLUDES =-Iinclude
LDFLAGS =
LIBS =
EXTRA_FLAGS :=
LIKWID_FLAG =
LIKWID_LINK_LIB =
ifeq ($(LIKWID), on)
LIKWID_FLAG = -DLIKWID_PERFMON $(LIKWID_INC)
LIKWID_LINK_LIB = $(LIKWID_LIB) -llikwid
endif
ifeq ($(CXX), g++)
FLAGS = -std=c++0x -Wall -Winline -Wshadow -W -O3 -fopenmp -march=native $(LIKWID_FLAG)
else
FLAGS = -std=c++0x -Wall -Winline -Wshadow -W -O3 -qopenmp -xHOST $(LIKWID_FLAG)
endif
CXXFLAGS = $(FLAGS) $(EXTRA_FLAGS)
all: clean test perf
perf: perf.o Grid.o PDE.o Solver.o timer.o
$(CXX) $(CXXFLAGS) -o perf Grid.o PDE.o Solver.o perf.o timer.o $(LDFLAGS) $(LIBS) $(LIKWID_LINK_LIB)
test: test.o Grid.o PDE.o Solver.o timer.o
$(CXX) $(CXXFLAGS) -o test Grid.o PDE.o Solver.o test.o timer.o $(LDFLAGS) $(LIBS) $(LIKWID_LINK_LIB)
perf.o: src/perf.cpp
$(CXX) -c $(CXXFLAGS) $(INCLUDES) src/perf.cpp
test.o: src/test.cpp
$(CXX) -c $(CXXFLAGS) $(INCLUDES) src/test.cpp
Solver.o: src/Solver.cpp
$(CXX) -c $(CXXFLAGS) $(INCLUDES) src/Solver.cpp
PDE.o: src/PDE.cpp
$(CXX) -c $(CXXFLAGS) $(INCLUDES) src/PDE.cpp
Grid.o: src/Grid.cpp
$(CXX) -c $(CXXFLAGS) $(INCLUDES) src/Grid.cpp
timer.o: src/timer.cpp
$(CXX) -c $(CXXFLAGS) $(INCLUDES) src/timer.cpp
clean:
@$(RM) -rf *.o perf test