2007-09-19 18:55:08 +00:00
|
|
|
# standard build: make
|
2007-11-29 21:34:11 +00:00
|
|
|
# build with Berkeley DB 4.1: make BDBDIR=/usr/local/BerkeleyDB.4.1
|
|
|
|
# build with TokuDB: make BDBDIR=~/svn/tokudb
|
2007-12-18 16:24:53 +00:00
|
|
|
# build with g++: make CC=g++
|
2013-04-16 23:57:28 -04:00
|
|
|
#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
|
2008-05-13 02:35:50 +00:00
|
|
|
HERE = db-benchmark-test
|
2013-04-16 23:57:28 -04:00
|
|
|
include $(TOKUROOT)include/Makefile.include
|
2008-05-13 02:35:50 +00:00
|
|
|
|
2008-07-18 12:34:24 +00:00
|
|
|
BENCHDBS = bench.bdb/ bench.tokudb ptest*.dir/ x.dir/ xfast.dir/
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2007-11-29 21:34:11 +00:00
|
|
|
ifdef BDBDIR
|
2013-04-16 23:57:31 -04:00
|
|
|
BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include -I$(PORTABILITY_HEADERS)
|
2013-04-16 23:57:31 -04:00
|
|
|
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -Wl,-rpath,$(BDBDIR)/lib $(LIBPORTABILITY) -lpthread
|
2007-09-19 18:55:08 +00:00
|
|
|
else
|
2013-04-16 23:57:31 -04:00
|
|
|
BDB_CPPFLAGS = -I$(PORTABILITY_HEADERS) -I../include
|
|
|
|
BDB_LDFLAGS = -ldb $(LIBPORTABILITY)
|
2007-09-19 18:55:08 +00:00
|
|
|
endif
|
2013-04-16 23:57:31 -04:00
|
|
|
BDB_CPPFLAGS += -D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
|
|
|
|
|
2013-04-16 23:57:28 -04:00
|
|
|
TOKUDB=libtokudb.$(SOEXT)
|
|
|
|
TDB_DLINK_FILES = $(TOKUROOT)lib/$(TOKUDB)
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2013-04-16 23:57:28 -04:00
|
|
|
TARGET_BDB = db-benchmark-test-bdb$(BINSUF)
|
2013-04-16 23:57:31 -04:00
|
|
|
SCANSCAN_BDB = scanscan-bdb$(BINSUF)
|
2013-04-16 23:57:28 -04:00
|
|
|
TARGET_TDB = db-benchmark-test-tokudb$(BINSUF)
|
|
|
|
SCANSCAN_TDB = scanscan-tokudb$(BINSUF)
|
2013-04-16 23:57:31 -04:00
|
|
|
TARGETS = $(TARGET_BDB) $(SCANSCAN_BDB) $(TARGET_TDB) $(SCANSCAN_TDB)
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2008-04-02 23:40:36 +00:00
|
|
|
default: build
|
2008-05-27 21:08:31 +00:00
|
|
|
build: $(TARGETS)
|
2013-04-16 23:57:31 -04:00
|
|
|
build.bdb: $(TARGET_BDB) $(SCANSCAN_BDB)
|
2013-04-16 23:57:28 -04:00
|
|
|
build.tdb: $(TARGET_TDB) $(SCANSCAN_TDB)
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2008-05-15 13:11:55 +00:00
|
|
|
check: check-default check-xfast check-x
|
2008-01-23 21:30:20 +00:00
|
|
|
|
|
|
|
check-default: $(TARGET_TDB)
|
2013-04-16 23:57:34 -04:00
|
|
|
$(VGRIND) ./$(TARGET_TDB) $(QUIET) $(SUMMARIZE_CMD)
|
2008-01-23 21:30:20 +00:00
|
|
|
|
|
|
|
check-x: $(TARGET_TDB)
|
2013-04-16 23:57:34 -04:00
|
|
|
$(VGRIND) ./$(TARGET_TDB) $(QUIET) -x --xcount 1000 --periter 100000 --env x.dir 10 $(SUMMARIZE_CMD)
|
2008-01-23 21:30:20 +00:00
|
|
|
|
2008-02-29 20:49:18 +00:00
|
|
|
|
|
|
|
# A fast transaction test that detects #455.
|
|
|
|
check-xfast: $(TARGET_TDB)
|
2013-04-16 23:57:34 -04:00
|
|
|
./$(TARGET_TDB) $(QUIET) --noserial -x --valsize 1000 --cachesize 8000000 --xcount 1000 --periter 20000 --env xfast.dir 1 $(SUMMARIZE_CMD)
|
2008-02-29 20:49:18 +00:00
|
|
|
|
|
|
|
|
2007-09-19 18:55:08 +00:00
|
|
|
clean:
|
2013-04-16 23:57:34 -04:00
|
|
|
rm -f $(TARGETS)
|
|
|
|
rm -rf $(BENCHDBS)
|
2013-04-16 23:57:28 -04:00
|
|
|
|
2013-04-16 23:57:31 -04:00
|
|
|
$(TARGET_TDB) $(SCANSCAN_TDB): BIN_FROM_C_FLAGS += -DDIRSUF=tokudb -I$(PORTABILITY_HEADERS) -I../include
|
2013-04-16 23:57:28 -04:00
|
|
|
|
|
|
|
ifneq ($(PROF),)
|
|
|
|
USE_STATIC=1
|
|
|
|
endif
|
2007-10-01 21:19:53 +00:00
|
|
|
|
2008-03-12 08:36:02 +00:00
|
|
|
# A hack to make gprof work. See #515.
|
2013-04-16 23:57:28 -04:00
|
|
|
ifneq ($(USE_STATIC),)
|
|
|
|
$(TARGET_TDB) $(SCANSCAN_TDB): DLINK_FILES=
|
|
|
|
|
2008-04-08 15:20:36 +00:00
|
|
|
OFILES = \
|
2013-04-16 23:57:28 -04:00
|
|
|
$(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
|
2013-04-16 23:57:34 -04:00
|
|
|
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES)
|
2013-04-16 23:57:28 -04:00
|
|
|
$(SCANSCAN_TDB): scanscan.c
|
2013-04-16 23:57:34 -04:00
|
|
|
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES)
|
2008-03-12 08:36:02 +00:00
|
|
|
else
|
2013-04-16 23:57:28 -04:00
|
|
|
$(TARGET_TDB) $(SCANSCAN_TDB): DLINK_FILES=$(TDB_DLINK_FILES)
|
|
|
|
ifeq ($(SOEXT),dll) #Windows does not support rpath.
|
|
|
|
$(TOKUDB): $(TOKUROOT)lib/$(TOKUDB)
|
2013-04-16 23:57:34 -04:00
|
|
|
cp $< $@
|
2013-04-16 23:57:28 -04:00
|
|
|
$(TOKUROOT)lib/$(TOKUDB):
|
2013-04-16 23:57:34 -04:00
|
|
|
cd $(@D) && $(MAKE) $(@F).install
|
2013-04-16 23:57:28 -04:00
|
|
|
$(TARGET_TDB) $(SCANSCAN_TDB): $(TOKUDB)
|
2008-03-12 08:36:02 +00:00
|
|
|
endif
|
2013-04-16 23:57:28 -04:00
|
|
|
$(TARGET_TDB) $(SCANSCAN_TDB): RPATH_DIRS=$(dir $(TDB_DLINK_FILES))
|
|
|
|
$(TARGET_TDB): db-benchmark-test.c
|
2013-04-16 23:57:34 -04:00
|
|
|
$(CC) $< $(BIN_FROM_C_FLAGS)
|
2013-04-16 23:57:28 -04:00
|
|
|
$(SCANSCAN_TDB): scanscan.c
|
2013-04-16 23:57:34 -04:00
|
|
|
$(CC) $< $(BIN_FROM_C_FLAGS)
|
2013-04-16 23:57:28 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
$(TARGET_BDB): db-benchmark-test.c
|
2013-04-16 23:57:34 -04:00
|
|
|
$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $< -o $@ -DDIRSUF=bdb $(BDB_LDFLAGS)
|
2013-04-16 23:57:31 -04:00
|
|
|
$(SCANSCAN_BDB): scanscan.c
|
2013-04-16 23:57:34 -04:00
|
|
|
$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $< -o $@ -DDIRSUF=bdb $(BDB_LDFLAGS)
|
2008-05-08 22:50:45 +00:00
|
|
|
|
2008-05-09 02:57:33 +00:00
|
|
|
PARGS =
|
2013-04-16 23:57:28 -04:00
|
|
|
|
|
|
|
ptest%: $(TARGET_TDB)
|
|
|
|
./$< --env $@.dir $(PARGS)
|
2008-05-08 22:50:45 +00:00
|
|
|
parallel-test-8: ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7
|
2008-05-22 21:23:56 +00:00
|
|
|
|