-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
executable file
·74 lines (53 loc) · 1.96 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
HOSTNAME = $(shell hostname)
CC=g++ # -4.8
ifeq ($(HOSTNAME), home-desktop)
CC=g++
endif
ifeq ($(shell echo $(HOSTNAME) | head -c 2), ip)
CC=g++ # EC2
endif
CFLAGS=-Wall -g -std=c++0x # -rdynami
.SUFFIXES: .o .cpp .h
SRC_DIRS = ./ ./benchmarks/ ./concurrency_control/ ./storage/ ./system/
INCLUDE = -I. -I./benchmarks -I./concurrency_control -I./storage -I./system -I./include
CFLAGS += $(INCLUDE) -lrt -lpthread -msse4.2 -march=native -ffast-math -Werror -O3 -D_GNU_SOURCE -fopenmp # -fsanitize=address # -D_FORTIFY_SOURCE=1 -fsanitize=address # -std=c++11 -fsanitize=address -fno-omit-frame-pointer
ifneq ($(JE_MALLOC), NO) # by default we use jemalloc
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
RELEASE_NAME := $(shell uname -r | cut -d '-' -f 3)
ifeq ($(RELEASE_NAME),generic)
LDFLAGS = -Wall -L. -L./libs -g -ggdb -std=c++0x -O3 -pthread -lrt -ljemalloc -lnuma
endif
ifeq ($(RELEASE_NAME),aws)
# changing to aws will hurt TC ycsb performance (9.xe6 to 6.7e6)???
LDFLAGS = -Wall -L. -L./libs -g -ggdb -std=c++0x -O3 -pthread -lrt -ljemalloc -lnuma # -lasan
endif
ifeq ($(RELEASE_NAME),Microsoft) # if Windows Subsystem
LDFLAGS = -Wall -L. -L./libs -g -ggdb -std=c++0x -O3 -pthread -lrt # -ljemalloc
endif
endif
ifeq ($(UNAME_S),Darwin)
LDFLAGS = -Wall -L. -g -ggdb -std=c++0x -O3 -pthread -lSystem.B # -ljemalloc
endif
else
LDFLAGS = -Wall -L. -L./libs -g -ggdb -std=c++0x -O3 -pthread -lrt -lnuma # -lasan
endif
LDFLAGS += $(CFLAGS)
CPPS = $(foreach dir, $(SRC_DIRS), $(wildcard $(dir)*.cpp))
OBJS = $(CPPS:.cpp=.o)
DEPS = $(CPPS:.cpp=.d)
all:rundb
rundb : $(OBJS)
$(CC) $(ARCH) -o $@ $^ $(LDFLAGS)
#We don't need to clean up when we're making these targets
NODEPS:=clean
ifeq (0, $(words $(findstring $(MAKECMDGOALS), $(NODEPS))))
-include $(OBJS:%.o=%.d)
endif
%.d: %.cpp
$(CC) $(ARCH) -MM -MT $*.o -MF $@ $(CFLAGS) $<
%.o: %.cpp %.d
$(CC) $(ARCH) -c $(CFLAGS) -o $@ $<
.PHONY: clean
clean:
rm -f rundb $(OBJS) $(DEPS)