-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
58 lines (40 loc) · 994 Bytes
/
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
DEBUG ?= 0
CXX ?= g++
CXXFLAGS = -std=c++11 -Wall -fopenmp
LDFLAGS = -std=c++11 -Wall -fopenmp
ifeq ($(strip $(DEBUG)),1)
CXXFLAGS += -g -O0
LDFLAGS += -g -O0
else
CXXFLAGS += -O3 -march=native
LDFLAGS += -O3 -march=native
endif
# Include directories
INC = -I../core
INC_EXT =
# Location of the libraries.
LIB = -L../core -lcore_s
LIB_EXT =
INC := $(INC) $(INC_EXT)
LIB := $(LIB) $(LIB_EXT)
CXXFLAGS += $(INC)
include ../core/make_blas.mk
TARGET = main main_buffer main_buffer2
all: $(TARGET)
.PRECIOUS: %.cc %.o
main.o: main.cc ../core/timer.h
$(CXX) -c $(CXXFLAGS) $<
main: main.o
$(CXX) $^ $(LIB) $(LDFLAGS) -o $@
main_buffer.o: main_buffer.cc ../core/timer.h
$(CXX) -c $(CXXFLAGS) $<
main_buffer: main_buffer.o
$(CXX) $^ $(LIB) $(LDFLAGS) -o $@
main_buffer2.o: main_buffer2.cc ../core/timer.h
$(CXX) -c $(CXXFLAGS) $<
main_buffer2: main_buffer2.o
$(CXX) $^ $(LIB) $(LDFLAGS) -o $@
clean:
rm -f *.o
rm -f $(TARGET)
.PHONY: all clean