Makefile 804 Bytes
Newer Older
1
# standard build: make
2 3
# build with Berkeley DB 4.1: make BDBDIR=/usr/local/BerkeleyDB.4.1
# build with TokuDB: make BDBDIR=~/svn/tokudb
4

5
BENCHDBS = bench.bdb/ bench.tokudb
6

7
OPTFLAGS = -O2
8 9
CFLAGS = -Wall -Werror -g
# CFLAGS += -pg
10
CFLAGS += $(OPTFLAGS)
11

12 13 14
ifdef BDBDIR
BDB_CPPFLAGS = -I$(BDBDIR)/include
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -lpthread -Wl,-rpath,$(BDBDIR)/lib
15
else
16 17
BDB_CPPFLAGS =
BDB_LDFLAGS = -ldb
18 19
endif

20
TARGETS = db-benchmark-test-bdb db-benchmark-test-tokudb
21

22
default: $(TARGETS)
23 24

clean:
25 26 27
	rm -rf $(TARGETS) $(BENCHDBS)

db-benchmark-test-tokudb: db-benchmark-test.c
28
	cc $(CFLAGS) -I../include -L../lib -ldb -Wl,-rpath,$(PWD)/../lib $< -o $@ -DDIRSUF=tokudb
29
db-benchmark-test-bdb: db-benchmark-test.c
30
	cc $(CFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS)                      $< -o $@ -DDIRSUF=bdb