2013-04-16 23:57:34 -04:00
|
|
|
# -*- Mode: Makefile -*-
|
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
|
2013-04-16 23:57:34 -04:00
|
|
|
# build with g++: make CC=g++
|
|
|
|
|
2013-04-16 23:57:34 -04:00
|
|
|
|
2013-04-16 23:57:34 -04:00
|
|
|
.DEFAULT_GOAL= build
|
|
|
|
TOKUROOT=../
|
2013-04-16 23:57:41 -04:00
|
|
|
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)include -I$(TOKUROOT)toku_include -I$(TOKUROOT)newbrt -I../range_tree -I../lock_tree
|
2013-04-16 23:57:34 -04:00
|
|
|
DEPEND_COMPILE += \
|
|
|
|
./*.h \
|
|
|
|
#end
|
|
|
|
|
|
|
|
HERE = db-benchmark-test-cxx
|
2013-04-16 23:57:37 -04:00
|
|
|
include $(TOKUROOT)toku_include/Makefile.include
|
2007-12-18 16:24:53 +00:00
|
|
|
|
|
|
|
BENCHDBS = bench.bdb/ bench.tokudb
|
|
|
|
|
|
|
|
OPTFLAGS = -O2
|
2013-04-16 23:58:57 -04:00
|
|
|
CXXFLAGS = $(GCC_VERSION_SPECIFIC) -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS)
|
2013-04-16 23:59:40 -04:00
|
|
|
|
|
|
|
ifeq ($(CC),icc)
|
|
|
|
CXX=icc
|
|
|
|
endif
|
|
|
|
|
2007-12-18 16:24:53 +00:00
|
|
|
# CFLAGS += -pg
|
|
|
|
|
|
|
|
ifdef BDBDIR
|
2013-04-16 23:57:34 -04:00
|
|
|
BDB_CPPFLAGS = -I$(BDBDIR)/include -DHAVE_CXX_STDHEADERS
|
2013-04-16 23:59:59 -04:00
|
|
|
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb_cxx -Wl,-rpath,$(BDBDIR)/lib -ldl
|
2007-12-18 16:24:53 +00:00
|
|
|
else
|
|
|
|
BDB_CPPFLAGS =
|
2013-04-16 23:59:41 -04:00
|
|
|
BDB_LDFLAGS = -ldb_cxx
|
2007-12-18 16:24:53 +00:00
|
|
|
endif
|
2013-04-16 23:59:41 -04:00
|
|
|
BDB_LDFLAGS += -lpthread -L../lib -Wl,-rpath,$(PWD)/../lib -ltokuportability
|
2007-12-18 16:24:53 +00:00
|
|
|
|
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
|
|
|
|
2008-05-13 02:35:50 +00:00
|
|
|
HERE = db-benchmark-test-cxx
|
|
|
|
ifeq ($(SUMMARIZE),1)
|
|
|
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
|
|
|
QUIET = -q
|
|
|
|
else
|
|
|
|
SUMMARIZE_CMD =
|
|
|
|
QUIET =
|
|
|
|
endif
|
|
|
|
|
2008-04-02 23:40:36 +00:00
|
|
|
default: build
|
2013-04-16 23:57:40 -04:00
|
|
|
build: $(TARGETS)
|
2007-12-18 16:24:53 +00:00
|
|
|
|
2008-02-09 22:57:33 +00:00
|
|
|
check: check-default
|
2008-01-24 15:39:26 +00:00
|
|
|
|
|
|
|
check-default: $(TARGET_TDB)
|
2013-04-16 23:58:55 -04:00
|
|
|
$(VGRIND) ./$(TARGET_TDB) $(QUIET) $(SUMMARIZE_CMD)
|
2008-01-24 15:39:26 +00:00
|
|
|
|
|
|
|
check-x: $(TARGET_TDB)
|
2013-04-16 23:58:55 -04:00
|
|
|
$(VGRIND) ./$(TARGET_TDB) -x $(QUIET) $(SUMMARIZE_CMD)
|
2008-01-24 15:39:26 +00:00
|
|
|
|
2007-12-18 16:24:53 +00:00
|
|
|
clean:
|
2013-04-16 23:57:34 -04:00
|
|
|
rm -rf $(TARGETS) $(BENCHDBS) *.gcno *.gcda *.gcov
|
2007-12-18 16:24:53 +00:00
|
|
|
|
2008-02-10 03:50:15 +00:00
|
|
|
db-benchmark-test-tokudb: ../lib/libtokudb_cxx.a
|
2007-12-18 16:24:53 +00:00
|
|
|
db-benchmark-test-tokudb: db-benchmark-test.cpp
|
2013-04-16 23:59:41 -04:00
|
|
|
$(CXX) $(CXXFLAGS) -I../include -I../toku_include -L../lib -Wl,-rpath,$(PWD)/../lib $< -o $@ -ltokudb -ltokudb_cxx -DDIRSUF=tokudb -lz -lpthread -ltokuportability
|
2007-12-18 19:37:59 +00:00
|
|
|
|
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
|