-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
79 lines (60 loc) · 1.29 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
75
76
77
78
79
ifdef D
OPT= -g
else
OPT= -g -flto -Ofast
endif
ifdef H
HUGE= -DHUGE_TLB
else
HUGE=
endif
ifdef NO_AVX
AVX_FLAGS=
else
AVX_FLAGS= -DUSE_AVX
endif
RESIZE_POLICY = -DENABLE_RESIZE
BLOCK_LOCKING = -DENABLE_BLOCK_LOCKING
ifdef NBL
BLOCK_LOCKING =
endif
ifdef NORESIZE
RESIZE_POLICY =
endif
ifdef INST
THRPT_POLICY = -DINSTAN_THRPT
endif
ifdef LATENCY
LATENCY_POLICY = -DLATENCY
endif
ifdef PMEM
PMEM_POLICY = -DPMEM
endif
OPT += $(RESIZE_POLICY) $(BLOCK_LOCKING) $(THRPT_POLICY) $(LATENCY_POLICY) $(PMEM_POLICY) $(AVX_FLAGS)
CC = clang
CPP = clang++
CFLAGS = $(OPT) -Wall -Werror -march=native -pthread $(HUGE)
INCLUDE = -I ./include
SOURCES = src/iceberg_table.c src/hashutil.c src/partitioned_counter.c src/lock.c
OBJECTS = $(subst src/,obj/,$(subst .c,.o,$(SOURCES)))
LIBS = -lssl -lcrypto
ifdef PMEM
LIBS += -lpmem -lpmemobj
endif
all: main ycsb
obj/%.o: src/%.c
@ mkdir -p obj
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
obj/main.o: main.cc
@ mkdir -p obj
$(CPP) $(CFLAGS) $(INCLUDE) -c $< -o $@
obj/ycsb.o: ycsb.cc
@ mkdir -p obj
$(CPP) $(CFLAGS) $(INCLUDE) -c $< -o $@
main: $(OBJECTS) obj/main.o
$(CPP) $(CFLAGS) $^ -o $@ $(LIBS)
ycsb: $(OBJECTS) obj/ycsb.o
$(CPP) $(CFLAGS) $^ -o $@ $(LIBS)
.PHONY: clean directories
clean:
rm -f main ycsb $(OBJECTS) obj/main.o obj/ycsb.o