forked from a993096281/YCSB-HWDB
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (33 loc) · 1.17 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
CC=g++
CXXFLAGS= -std=c++11 -g -Wall -I./
LDFLAGS= -lpthread
LIB_SOURCES= \
core/core_workload.cc \
db/db_factory.cc \
db/hashtable_db.cc \
##HWDB
HWDB_SOURCES= db/hwdb_db.cc
HWDB_LIBRARY= -lhwdb
HWDB_DEFS= -DYCSB_HWDB
HWDB_OBJECTS=$(HWDB_SOURCES:.cc=.o)
##
##rocksdb
ROCKSDB_SOURCES= db/rocksdb_db.cc
ROCKSDB_LIBRARY= -lrocksdb -lz ### -lz -lzstd -llz4 -lsnappy是rocksdb编译的时候如果检测到这些压缩链接库会使用,所以这里也要添加
ROCKSDB_DEFS= -DYCSB_ROCKSDB
ROCKSDB_OBJECTS=$(ROCKSDB_SOURCES:.cc=.o)
##
OBJECTS=$(LIB_SOURCES:.cc=.o)
EXEC=ycsbc
ONLY_HWDB_SOURCES=$(LIB_SOURCES) $(HWDB_SOURCES)
ONLY_ROCKSDB_SOURCES=$(LIB_SOURCES) $(ROCKSDB_SOURCES)
ALL_SOURCES=$(LIB_SOURCES) $(HWDB_SOURCES) $(ROCKSDB_SOURCES)
all: clean
$(CC) $(CXXFLAGS) $(HWDB_DEFS) $(ROCKSDB_DEFS) ycsbc.cc $(ALL_SOURCES) -o $(EXEC) $(LDFLAGS) $(HWDB_LIBRARY) $(ROCKSDB_LIBRARY)
hwdb: clean
$(CC) $(CXXFLAGS) $(HWDB_DEFS) ycsbc.cc $(ONLY_HWDB_SOURCES) -o $(EXEC) $(LDFLAGS) $(HWDB_LIBRARY)
rocksdb: clean
$(CC) $(CXXFLAGS) $(ROCKSDB_DEFS) ycsbc.cc $(ONLY_ROCKSDB_SOURCES) -o $(EXEC) $(LDFLAGS) $(ROCKSDB_LIBRARY)
clean:
rm -f $(EXEC)
.PHONY: clean rocksdb hwdb