forked from LMDB/dbbench
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (50 loc) · 1.94 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
# Copyright (c) 2017 Howard Chu @ Symas Corp.
MAINSRCS = main.c args.c histogram.c random.c
MAINOBJS = main.o args.o histogram.o random.o
TESTSRCS = t_bdb.c t_lmdb.c t_leveldb.cc t_basho.cc t_hyper.cc t_rocksdb.cc \
t_pebbles.cc
TESTOBJS = t_bdb.o t_lmdb.o t_leveldb.o t_basho.o t_hyper.o t_rocksdb.o \
t_pebbles.o
BINDIR = bin
TESTS = $(BINDIR)/t_bdb $(BINDIR)/t_lmdb $(BINDIR)/t_leveldb \
$(BINDIR)/t_basho $(BINDIR)/t_hyper $(BINDIR)/t_rocksdb $(BINDIR)/t_badger \
$(BINDIR)/t_pebbles
OPT = -O2 -DNDEBUG
CC = gcc -pthread
CXX = g++ -pthread
CFLAGS = $(OPT)
all: $(BINDIR) $(TESTS)
$(BINDIR):
mkdir $(BINDIR)
clean:
rm -f dbb.o $(MAINOBJS) $(TESTOBJS) $(TESTS)
dbb.o: $(MAINOBJS)
$(LD) -r -o $@ $^
$(BINDIR)/t_bdb: dbb.o t_bdb.o
$(CC) -o $@ $^ -Wl,-Bstatic -ldb -Wl,-Bdynamic -lm
$(BINDIR)/t_lmdb: dbb.o t_lmdb.o
$(CC) -o $@ $^ -Wl,-Bstatic -llmdb -Wl,-Bdynamic -lsnappy -lm
$(BINDIR)/t_leveldb: dbb.o t_leveldb.o
$(CXX) -o $@ $^ ../leveldb/out-static/libleveldb.a -lsnappy
t_leveldb.o: t_leveldb.cc
$(CXX) -c $(CFLAGS) -I../leveldb/include $^
$(BINDIR)/t_basho: dbb.o t_basho.o
$(CXX) -o $@ $^ ../basho_leveldb/libleveldb.a -lsnappy
t_basho.o: t_basho.cc
$(CXX) -c $(CFLAGS) -I../basho_leveldb/include $^
$(BINDIR)/t_hyper: dbb.o t_hyper.o
$(CXX) -o $@ $^ ../HyperLevelDB/.libs/libhyperleveldb.a -lsnappy
t_hyper.o: t_hyper.cc
$(CXX) -c $(CFLAGS) -I../HyperLevelDB/include $^
$(BINDIR)/t_pebbles: dbb.o t_pebbles.o
$(CXX) -o $@ $^ ../pebblesdb/.libs/libhyperleveldb.a -lsnappy
t_pebbles.o: t_pebbles.cc
$(CXX) -c $(CFLAGS) -I../pebblesdb/include $^
$(BINDIR)/t_rocksdb: dbb.o t_rocksdb.o
$(CXX) -o $@ $^ ../rocksdb/librocksdb.a -lsnappy -llz4 -lz -lbz2 -lzstd
t_rocksdb.o: t_rocksdb.cc
$(CXX) -std=c++11 -c $(CFLAGS) -I../rocksdb/include $^
$(BINDIR)/t_badger: t_badger/t_badger
cp t_badger/t_badger $(BINDIR)
t_badger/t_badger: t_badger/cbadger.go t_badger/main.go t_badger/t_badger.c $(MAINSRCS)
cd t_badger; go build