2007-12-18 16:24:53 +00:00
|
|
|
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
|
|
|
|
|
|
|
# standard build: make
|
|
|
|
# build with Berkeley DB 4.1: make BDBDIR=/usr/local/BerkeleyDB.4.1
|
|
|
|
# build with TokuDB: make BDBDIR=~/svn/tokudb
|
|
|
|
|
|
|
|
BENCHDBS = bench.bdb/ bench.tokudb
|
|
|
|
|
|
|
|
OPTFLAGS = -O2
|
2008-01-18 14:43:32 +00:00
|
|
|
CXXFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS)
|
2007-12-18 16:24:53 +00:00
|
|
|
# CFLAGS += -pg
|
|
|
|
|
|
|
|
ifdef BDBDIR
|
|
|
|
BDB_CPPFLAGS = -I$(BDBDIR)/include
|
2007-12-20 15:21:21 +00:00
|
|
|
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb_cxx -lpthread -Wl,-rpath,$(BDBDIR)/lib
|
2007-12-18 16:24:53 +00:00
|
|
|
else
|
|
|
|
BDB_CPPFLAGS =
|
2007-12-20 15:21:21 +00:00
|
|
|
BDB_LDFLAGS = -ldb_cxx -lpthread
|
2007-12-18 16:24:53 +00:00
|
|
|
endif
|
|
|
|
|
2008-01-24 15:39:26 +00:00
|
|
|
TARGET_BDB = db-benchmark-test-bdb
|
|
|
|
TARGET_TDB = db-benchmark-test-tokudb
|
|
|
|
TARGETS = $(TARGET_BDB) $(TARGET_TDB)
|
2007-12-18 16:24:53 +00:00
|
|
|
|
|
|
|
default: $(TARGETS)
|
|
|
|
|
2008-01-24 15:39:26 +00:00
|
|
|
check: check-default check-x
|
|
|
|
|
|
|
|
check-default: $(TARGET_TDB)
|
|
|
|
$(VALGRIND) ./$(TARGET_TDB)
|
|
|
|
|
|
|
|
check-x: $(TARGET_TDB)
|
|
|
|
$(VALGRIND) ./$(TARGET_TDB) -x
|
|
|
|
|
2007-12-18 16:24:53 +00:00
|
|
|
clean:
|
2008-01-18 14:43:32 +00:00
|
|
|
rm -rf $(TARGETS) $(BENCHDBS) *.gcno *.gcda *.gcov
|
2007-12-18 16:24:53 +00:00
|
|
|
|
2007-12-18 19:37:59 +00:00
|
|
|
db-benchmark-test-tokudb: ../lib/libtdb_cxx.a
|
2007-12-18 16:24:53 +00:00
|
|
|
db-benchmark-test-tokudb: db-benchmark-test.cpp
|
2007-12-18 19:37:59 +00:00
|
|
|
# $(CXX) $(CXXFLAGS) -I../include $< -o $@ -DDIRSUF=tokudb ../lib/libdb.a ../lib/libtdb_cxx.a -lz
|
|
|
|
$(CXX) $(CXXFLAGS) -I../include -L../lib -Wl,-rpath,$(PWD)/../lib $< -o $@ -ldb -ltdb_cxx -DDIRSUF=tokudb
|
|
|
|
|
2007-12-18 16:24:53 +00:00
|
|
|
db-benchmark-test-bdb: db-benchmark-test.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS) $< -o $@ -DDIRSUF=bdb
|