mariadb/db-benchmark-test/Makefile
Rich Prohaska 5aab80472e build db-benchmark-test on linux. addresses #1320
git-svn-id: file:///svn/toku/tokudb.1032b@8312 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-16 23:57:31 -04:00

113 lines
3.5 KiB
Makefile

# standard build: make
# build with Berkeley DB 4.1: make BDBDIR=/usr/local/BerkeleyDB.4.1
# build with TokuDB: make BDBDIR=~/svn/tokudb
# build with g++: make CC=g++
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= build
TOKUROOT=../
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)newbrt -I../range_tree -I../lock_tree
DEPEND_COMPILE += \
../*.h \
../range_tree/*.h \
../lock_tree/*.h \
test.h \
#end
SKIP_NORETURN=1 #Do not add the -Wmissing-noreturn flag
HERE = db-benchmark-test
include $(TOKUROOT)include/Makefile.include
BENCHDBS = bench.bdb/ bench.tokudb ptest*.dir/ x.dir/ xfast.dir/
ifdef BDBDIR
BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include -I$(PORTABILITY_HEADERS)
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -Wl,-rpath,$(BDBDIR)/lib $(LIBPORTABILITY) -lpthread
else
BDB_CPPFLAGS = -I$(PORTABILITY_HEADERS) -I../include
BDB_LDFLAGS = -ldb $(LIBPORTABILITY)
endif
BDB_CPPFLAGS += -D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
TOKUDB=libtokudb.$(SOEXT)
TDB_DLINK_FILES = $(TOKUROOT)lib/$(TOKUDB)
TARGET_BDB = db-benchmark-test-bdb$(BINSUF)
SCANSCAN_BDB = scanscan-bdb$(BINSUF)
TARGET_TDB = db-benchmark-test-tokudb$(BINSUF)
SCANSCAN_TDB = scanscan-tokudb$(BINSUF)
TARGETS = $(TARGET_BDB) $(SCANSCAN_BDB) $(TARGET_TDB) $(SCANSCAN_TDB)
default: build
build: $(TARGETS)
build.bdb: $(TARGET_BDB) $(SCANSCAN_BDB)
build.tdb: $(TARGET_TDB) $(SCANSCAN_TDB)
check: check-default check-xfast check-x
check-default: $(TARGET_TDB)
$(MAYBEATSIGN)$(VGRIND) ./$(TARGET_TDB) $(QUIET) $(SUMMARIZE_CMD)
check-x: $(TARGET_TDB)
$(MAYBEATSIGN)$(VGRIND) ./$(TARGET_TDB) $(QUIET) -x --xcount 1000 --periter 100000 --env x.dir 10 $(SUMMARIZE_CMD)
# A fast transaction test that detects #455.
check-xfast: $(TARGET_TDB)
$(MAYBEATSIGN)./$(TARGET_TDB) $(QUIET) --noserial -x --valsize 1000 --cachesize 8000000 --xcount 1000 --periter 20000 --env xfast.dir 1 $(SUMMARIZE_CMD)
clean:
$(MAYBEATSIGN)rm -f $(TARGETS)
$(MAYBEATSIGN)rm -rf $(BENCHDBS)
$(TARGET_TDB) $(SCANSCAN_TDB): BIN_FROM_C_FLAGS += -DDIRSUF=tokudb -I$(PORTABILITY_HEADERS) -I../include
ifneq ($(PROF),)
USE_STATIC=1
endif
# A hack to make gprof work. See #515.
ifneq ($(USE_STATIC),)
$(TARGET_TDB) $(SCANSCAN_TDB): DLINK_FILES=
OFILES = \
$(TOKUROOT)src/ydb.lib \
$(TOKUROOT)src/range_tree/rangetree.lib \
$(TOKUROOT)src/lock_tree/locktree.lib \
$(TOKUROOT)newbrt/newbrt.lib \
$(LIBPORTABILITY) \
#end
$(TARGET_TDB): db-benchmark-test.c
$(MAYBEATSIGN)$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES)
$(SCANSCAN_TDB): scanscan.c
$(MAYBEATSIGN)$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES)
else
$(TARGET_TDB) $(SCANSCAN_TDB): DLINK_FILES=$(TDB_DLINK_FILES)
ifeq ($(SOEXT),dll) #Windows does not support rpath.
$(TOKUDB): $(TOKUROOT)lib/$(TOKUDB)
$(MAYBEATSIGN)cp $< $@
$(TOKUROOT)lib/$(TOKUDB):
$(MAYBEATSIGN)cd $(@D) && $(MAKE) $(@F).install
$(TARGET_TDB) $(SCANSCAN_TDB): $(TOKUDB)
endif
$(TARGET_TDB) $(SCANSCAN_TDB): RPATH_DIRS=$(dir $(TDB_DLINK_FILES))
$(TARGET_TDB): db-benchmark-test.c
$(MAYBEATSIGN)$(CC) $< $(BIN_FROM_C_FLAGS)
$(SCANSCAN_TDB): scanscan.c
$(MAYBEATSIGN)$(CC) $< $(BIN_FROM_C_FLAGS)
endif
$(TARGET_BDB): db-benchmark-test.c
$(MAYBEATSIGN)$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $< -o $@ -DDIRSUF=bdb $(BDB_LDFLAGS)
$(SCANSCAN_BDB): scanscan.c
$(MAYBEATSIGN)$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $< -o $@ -DDIRSUF=bdb $(BDB_LDFLAGS)
PARGS =
ptest%: $(TARGET_TDB)
./$< --env $@.dir $(PARGS)
parallel-test-8: ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7