Commit 061810b8 authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

refs #5525 remove obsolete Makefiles


git-svn-id: file:///svn/toku/tokudb@48240 c7de825b-a66e-492c-adef-691d508d4ae1
parent ebc250cc
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= default
TOKUROOT=./
include $(TOKUROOT)toku_include/Makefile.include
default: build
ifeq ($(TOKU_SKIP_CXX),1)
SRCDIRS_CXX =
else
SRCDIRS_CXX = cxx db-benchmark-test-cxx
endif
SRCDIRS = $(OS_CHOICE) ft src/range_tree src/lock_tree src utils db-benchmark-test $(SRCDIRS_CXX)
BUILDDIRS = $(SRCDIRS) man/texi
ifeq ($(OS_CHOICE),windows)
.NOTPARALLEL:; #Windows/cygwin jobserver does not properly handle submakes. Serialize
endif
ft.dir: $(OS_CHOICE).dir
src/range_tree.dir: $(OS_CHOICE).dir
src/lock_tree.dir: src/range_tree.dir
src.dir: ft.dir src/lock_tree.dir
utils.dir: src.dir
db-benchmark-test.dir: src.dir
cxx.dir: src.dir
db-benchmark-test-cxx.dir: cxx.dir
%.dir:
cd $(patsubst %.dir, %, $@) && $(MAKE) build
build: $(patsubst %,%.dir, $(BUILDDIRS))
%.build:
cd $(patsubst %.build, %,$@) && $(MAKE) build
%.local:
cd $(patsubst %.local, %,$@) && $(MAKE) local
%.check:
cd $(patsubst %.check, %,$@) && $(MAKE) check
release: linux.local ft.local src.local release.local
CHECKS = $(patsubst %,%.checkdir,$(SRCDIRS))
# This is the original check rule
# The stuff below allows "make -j2 -k check" to work
#check:
# for d in $(SRCDIRS); do (cd $$d; $(MAKE) -k check); done
%.checkdir:
cd $* && $(MAKE) -k check
summarize: SUMMARIZE=1
summarize: VERBOSE=0
summarize: check
check: $(CHECKS)
.PHONY: fastbuild fastbuildtests fastcheck fastcheckft fastcheckydb fastcheckonlyfail fastcheckonlyfailft fastcheckonlyfailydb
fastbuild:
$(MAKE) -s -k -C linux
$(MAKE) -s -k -C ft local
$(MAKE) -s -k -C src local
$(MAKE) -s -k -C utils
fastbuildtests: fastbuild
$(MAKE) -s -k -C ft/tests
$(MAKE) -s -k -C src/tests tests.tdb
fastcheck: fastcheckft fastcheckydb
fastcheckft: fastbuildtests
$(MAKE) -s -k -C ft/tests fastcheck
fastcheckydb: fastbuildtests
$(MAKE) -s -k -C src/tests fastcheck.tdb
fastcheckonlyfail: fastcheckonlyfailft fastcheckonlyfailydb
fastcheckonlyfailft: fastbuildtests
$(MAKE) -s -k -C ft/tests fastcheckonlyfail
fastcheckonlyfailydb: fastbuildtests
$(MAKE) -s -k -C src/tests fastcheckonlyfail.tdb
clean: $(patsubst %,%.dir.clean,$(SRCDIRS)) cleanlib
cleanlib:
rm -rf lib/*.$(SOEXT) $(filter-out lib/liblzma_gcc_dbg.$(AEXT) lib/liblzma_gcc_opt.$(AEXT) lib/liblzma_icc_dbg.$(AEXT) lib/liblzma_icc_opt.$(AEXT),$(wildcard lib/*.$(AEXT))) lib/*.bundle lib/*.olist
# This does not work, and probably hasn't worked since revision ~2000
# install:
# ./install.bash
# Default to building locally in one's home directory
PREFIX = $(HOME)/local
# This is a quick hack for an install rule
install: release
mkdir -p $(PREFIX)/lib $(PREFIX)/include
/bin/cp release/lib/libtokudb.so $(PREFIX)/lib
/bin/cp release/lib/libtokuportability.so $(PREFIX)/lib
/bin/cp release/include/db.h $(PREFIX)/include/tokudb.h
/bin/cp release/include/tdb-internal.h $(PREFIX)/include
/bin/cp release/include/toku_list.h $(PREFIX)/include
uninstall:
/bin/rm -f $(PREFIX)/lib/libtokudb.so $(PREFIX)/lib/libtokuportability.so
/bin/rm -f $(PREFIX)/lib/libtokuportability.so
/bin/rm -f $(PREFIX)/include/tokudb.h $(PREFIX)/include/tdb-internal.h
/bin/rm -f $(PREFIX)/include/toku_list.h
# maybe we should have a coverage target in each makefile
build-coverage:
$(MAKE) build OPTFLAGS= GCOV_FLAGS="-fprofile-arcs -ftest-coverage"
# this is messy now since we dont have consistent make targets
check-coverage: check-coverage-ft check-coverage-src-tests check-coverage-utils check-coverage-cxx-tests \
check-coverage-db-benchmark-test check-coverage-db-benchmark-test-cxx \
check-coverage-range-tree-tests check-coverage-lock-tree-tests
check-coverage-ft:
(cd ft && $(MAKE) -k check VGRIND="")
check-coverage-src-tests:
(cd src/tests && $(MAKE) -k check.tdb VGRIND="")
check-coverage-utils:
(cd utils && $(MAKE) -k test-coverage)
check-coverage-cxx-tests:
(cd cxx/tests && $(MAKE) -k check VGRIND="")
check-coverage-db-benchmark-test:
(cd db-benchmark-test && $(MAKE) -k check VGRIND="")
check-coverage-db-benchmark-test-cxx:
(cd db-benchmark-test-cxx && $(MAKE) -k check VGRIND="")
check-coverage-range-tree-tests:
(cd src/range_tree/tests && $(MAKE) clean && $(MAKE) -k check.lin VGRIND="" OPTFLAGS=-O0 GCOV_FLAGS="-fprofile-arcs -ftest-coverage")
check-coverage-lock-tree-tests:
(cd src/lock_tree/tests && $(MAKE) clean && $(MAKE) -k check.lin VGRIND="" OPTFLAGS=-O0 GCOV_FLAGS="-fprofile-arcs -ftest-coverage")
BDB = 4_6
BDBDIR = ../../../berkeleydb
MYSQL_H = -I$(BDBDIR)/db-4.1.25/build_unix/
OPTFLAGS = -O2
ifeq ($(GCCVERSION),4.4.2)
GCC_VERSION_SPECIFIC_WARNINGS = -Wno-strict-aliasing -Wno-deprecated
else ifeq ($(GCCVERSION),4.4.1)
GCC_VERSION_SPECIFIC_WARNINGS = -Wno-strict-aliasing -Wno-deprecated
endif
CFLAGS = $(GCC_VERSION_SPECIFIC_WARNINGS) -Wall -W -Werror -g $(OPTFLAGS)
CPPFLAGS = -I. -I../toku_include
ifeq ($(CC),icc)
CFLAGS += -diag-disable 188
endif
default: ../include/db.h
../include/db.h: make_tdb
./make_tdb > $@
hfiles: tdb.h
clean:
rm -f *.o make_tdb
# 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$(TOKUROOT)ft -I$(TOKUROOT)include -I$(TOKUROOT)/toku_include -I$(TOKUROOT)src
DEPEND_COMPILE += \
../*.h \
../range_tree/*.h \
../lock_tree/*.h \
test.h \
#end
HERE = db-benchmark-test
include $(TOKUROOT)toku_include/Makefile.include
BENCHDBS = bench.bdb/ bench.tokudb ptest*.dir/ x.dir/ xfast.dir/ scanrace.tokudb/ 4g.dir/ rowsize.*.dir/
TDB_DLINK_FILES = $(TOKUROOT)lib/$(TOKUDB)
TARGET_BDB = db-benchmark-test-bdb$(BINSUF)
SCANSCAN_BDB = scanscan-bdb$(BINSUF)
PTQUERY_BDB = ptquery-bdb$(BINSUF)
TXNCOMMIT_BDB = txncommit-bdb$(BINSUF)
TARGET_TDB = db-benchmark-test-tokudb$(BINSUF)
SCANSCAN_TDB = scanscan-tokudb$(BINSUF)
SCANRACE_TDB = scanrace-tokudb$(BINSUF)
PTQUERY_TDB = ptquery-tokudb$(BINSUF)
TXNCOMMIT_TDB = txncommit-tokudb$(BINSUF)
MULTIBENCH_TDB = multi-bench-tokudb$(BINSUF)
VERIFY_TDB = db-verify-tokudb$(BINSUF)
TARGETS_BDB = $(TARGET_BDB) $(SCANSCAN_BDB) $(PTQUERY_BDB) $(TXNCOMMIT_BDB)
TARGETS = $(TARGETS_BDB) $(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB) $(PTQUERY_TDB) $(TXNCOMMIT_TDB)
ifeq ($(OS_CHOICE),windows)
ifdef BDBDIR
$(TARGETS_BDB): INCLUDEDIRS=-I$(BDBDIR)/include
$(TARGETS_BDB): RPATH_DIRS=$(BDBDIR)/lib
endif
ifeq ($(DEBUG),0)
WINDOWS_BDB_LIB_NAME=libdb.$(SOEXT)
$(WINDOWS_BDB_LIB_NAME):
cp $(BDBDIR)/lib/libdb[0-9][0-9].$(SOEXT) ./
else
WINDOWS_BDB_LIB_NAME=libdbd.$(SOEXT)
$(WINDOWS_BDB_LIB_NAME):
cp $(BDBDIR)/lib/libdb[0-9][0-9]d.$(SOEXT) ./
endif
$(TARGETS_BDB): DLINK_FILES=$(BDBDIR)/lib/$(WINDOWS_BDB_LIB_NAME)
#empty
else
WINDOWS_BDB_LIB_NAME=
#linux
ifdef BDBDIR
$(TARGETS_BDB): INCLUDEDIRS=-I$(BDBDIR)/include
$(TARGETS_BDB): RPATH_DIRS=$(BDBDIR)/lib
endif
$(TARGETS_BDB): DLINK_FILES=db.$(SOEXT)
endif
#empty on purpose
CPPFLAGS+= -D_GNU_SOURCE
TOKUDB=libtokudb.$(SOEXT)
default: build
ifeq ($(OS_CHOICE),windows)
build: build.tdb;
else
build: build.tdb build.bdb;
endif
build.bdb: $(TARGET_BDB) $(SCANSCAN_BDB) $(WINDOWS_BDB_LIB_NAME) $(PTQUERY_BDB) $(TXNCOMMIT_BDB)
build.tdb: $(TARGET_TDB) $(SCANSCAN_TDB) $(MULTIBENCH_TDB) $(PTQUERY_TDB) $(TXNCOMMIT_TDB)
check: check-default check-default-small check-rowsize check-xfast check-x check-x-small check-no-rollback check-4G child.benchmark.dir
SUPPORT_KEYSIZE=$$((3*1024)) # at least 3KiB
SUPPORT_ROWSIZE=$$((80*1024)) # at least 80KiB
.PHONY: check-rowsize
check-rowsize: $(TARGET_TDB)
( $(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.key.dir --keysize $(SUPPORT_KEYSIZE) --periter 256 1 && \
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.val.dir --valsize $(SUPPORT_ROWSIZE) --periter 256 1 && \
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.keyval.dir --keysize $(SUPPORT_KEYSIZE) --valsize $(SUPPORT_ROWSIZE) --periter 256 1 ) $(SUMMARIZE_CMD)
check-default: $(TARGET_TDB)
./$(TARGET_TDB) $(VERBVERBOSE) $(SUMMARIZE_CMD)
# The small one can run valgrind
check-default-small: $(TARGET_TDB)
$(VGRIND) ./$(TARGET_TDB) --env default.small $(VERBVERBOSE) 1 $(SUMMARIZE_CMD)
check-x: $(TARGET_TDB)
./$(TARGET_TDB) $(VERBVERBOSE) -x --xcount 1000 --periter 100000 --env x.dir 10 $(SUMMARIZE_CMD)
# The small one can run valgrind
check-x-small: $(TARGET_TDB)
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) -x --xcount 100 --periter 10000 --env x.dir.small 1 $(SUMMARIZE_CMD)
# check-scanrace: VGRIND=tcheck_cl -w 140 -s 4 -p nothreads,delay=2,stall=900,noverbose
check-scanrace: $(SCANRACE_TDB) $(TARGET_TDB)
( ./$(TARGET_TDB) --env scanrace.tokudb --periter 10000 --pagesize 4096 1 && \
$(VGRIND) ./$(SCANRACE_TDB) --env scanrace.tokudb ) $(SUMMARIZE_CMD)
# A fast transaction test that detects #455.
check-xfast: $(TARGET_TDB)
./$(TARGET_TDB) $(VERBVERBOSE) --noserial -x --valsize 1000 --cachesize 8000000 --xcount 1000 --periter 20000 --env xfast.dir 1 $(SUMMARIZE_CMD)
# A relatively fast test that detects #853 (don't log changes to a dictionary created in the same txn)
check-no-rollback: $(TARGET_TDB)
./$(TARGET_TDB) $(VERBVERBOSE) --env no-rollback.dir --singlex --nolog --check_small_rollback $(SUMMARIZE_CMD)
# Check to make sure that if we make a file that's bigger than 4GB that we can read the file back out and get all the rows.
ifeq ($(TOKU_SKIP_4G),1)
check-4G:
@echo SKIPPED SLOW TEST $@
else
check-4G: $(TARGET_TDB) $(SCANSCAN_TDB)
( ./$(TARGET_TDB) $(VERBVERBOSE) --env 4g.dir --norandom --compressibility 1 --valsize 10000 1 && \
./$(SCANSCAN_TDB) --env 4g.dir --lwc --prelock --prelockflag --nox > 4g.out && \
fgrep "(1048576 rows)" 4g.out > /dev/null ) $(SUMMARIZE_CMD)
endif
clean:
rm -f $(TARGETS) 4g.out
rm -rf *.dir $(BENCHDBS)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB) $(PTQUERY_TDB) $(VERIFY_TDB): BIN_FROM_C_FLAGS+=-DDIRSUF=tokudb -I$(PORTABILITY_HEADERS) -I$(TOKUROOT)toku_include -I$(TOKUROOT)include
ifneq ($(PROF),)
USE_STATIC=1
endif
# A hack to make gprof work. See #515.
ifneq ($(USE_STATIC),)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB) $(PTQUERY_TDB): DLINK_FILES=
OFILES = \
$(TOKUROOT)/src/ydb_lib.o \
$(TOKUROOT)src/ydb.lib \
$(TOKUROOT)src/lock_tree/locktree.lib \
$(TOKUROOT)src/range_tree/rangetree.lib \
$(TOKUROOT)ft/ft.lib \
$(LIBPORTABILITY_SO) \
#end
$(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES) $(LINK_MUST_BE_LAST)
$(SCANSCAN_TDB): scanscan.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES) $(LINK_MUST_BE_LAST)
$(PTQUERY_TDB): ptquery.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES) $(LINK_MUST_BE_LAST)
$(SCANRACE_TDB): scanrace.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES) $(LINK_MUST_BE_LAST)
$(MULTIBENCH_TDB): multi-bench.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES) $(LINK_MUST_BE_LAST)
$(TXNCOMMIT_TDB): txncommit.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES) $(LINK_MUST_BE_LAST)
else
ifeq ($(OS_CHOICE),windows)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): $(WIN_YDB) $(PTHREAD_LOCAL)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): LINK_FILES+=$(WIN_YDB)
else
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB) $(PTQUERY_TDB) $(TXNCOMMIT_TDB) $(VERIFY_TDB): DLINK_FILES=$(TDB_DLINK_FILES)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB) $(PTQUERY_TDB) $(TXNCOMMIT_TDB) $(VERIFY_TDB): RPATH_DIRS=$(dir $(TDB_DLINK_FILES))
endif
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB) $(PTQUERY_TDB) $(TXNCOMMIT_TDB) $(VERIFY_TDB): LDLIBS+=-ltokuportability
$(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(SCANSCAN_TDB): scanscan.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(PTQUERY_TDB): ptquery.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(SCANRACE_TDB): scanrace.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(MULTIBENCH_TDB): multi-bench.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(TXNCOMMIT_TDB): txncommit.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(VERIFY_TDB): db-verify.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
endif
$(TARGETS_BDB): CPPFLAGS+=-DDIRSUF=bdb -DTOKU_ALLOW_DEPRECATED
$(TARGETS_BDB): LDFLAGS+=-L$(TOKUROOT)lib -Wl,-rpath,$(shell pwd)/$(TOKUROOT)lib
$(TARGETS_BDB): LDLIBS+=-ltokuportability
$(TARGET_BDB): db-benchmark-test.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(SCANSCAN_BDB): scanscan.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(TXNCOMMIT_BDB): txncommit.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(PTQUERY_BDB): ptquery.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
PARGS =
ptest%: $(TARGET_TDB)
./$< --env $@.dir $(PARGS)
parallel-test-8: ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7
#benchmarks
.PHONY: %.manybenchmark
.PHONY: %.manyflattenedscan %.flattenedscan
.PHONY: %.manyflatteningscan %.flatteningscan
BENCH_TIME=time
SCAN_TIME=time
BENCH_RUNS=5
QUIET_BENCH_ARG=
%.manybenchmark: SHELL=/bin/bash
%.manybenchmark:
$(BENCH_TIME) for (( i = 0; i < $(BENCH_RUNS); i++ )) ; do rm -rf $*.benchmark.dir; $(MAKE) -s $*.benchmark.dir BENCH_TIME= QUIET_BENCH_ARG=-q ; done
%.benchmark.dir: SHELL=/bin/bash
%.benchmark.dir: $(TARGET_TDB)
rm -rf $@
$(BENCH_TIME) ./$< --env $@ $(QUIET_BENCH_ARG) $(EXTRA_BENCH_ARGS)
DB_TYPES = no-txn txn abort child child_abort child_abortfirst txn1 abort1 child1 child-abort1 child_abortfirst1
no-txn.benchmark.dir: EXTRA_BENCH_ARGS=
txn.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock
abort.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --abort
child.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --singlex-child
child-abort.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --abort --singlex-child
child-abortfirst.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --abort --singlex-child --finish-child-first
txn1.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --insert1first
abort1.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --abort --insert1first
child1.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --singlex-child --insert1first
child-abort1.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --abort --singlex-child --insert1first
child-abortfirst1.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --abort --singlex-child --finish-child-first --insert1first
QUIET_SCAN_ARG=
SCANSCAN_ARGS=--lwc --prelock --prelockflag --cachesize 268435456 # scanscan default, cache of windows (256MB)
SCANSCAN_TDB = scanscan-tokudb$(BINSUF)
%.manyflatteningscan: SHELL=/bin/bash
%.manyflatteningscan:
$(SCAN_TIME) for (( i = 0; i < $(BENCH_RUNS); i++ )) ; do $(MAKE) -s $*.flatteningscan SCAN_TIME= "QUIET_SCAN_ARG= >/dev/null" ; done
%.flatteningscan: QUIET_BENCH_ARG=-q
%.flatteningscan: SHELL=/bin/bash
%.flatteningscan: BENCH_TIME=
%.flatteningscan: $(SCANSCAN_TDB) %.benchmark.dir
rm -rf $@.dir
cp -R $*.benchmark.dir $@.dir
$(SCAN_TIME) ./$< --env $@.dir $(SCANSCAN_ARGS) $(QUIET_SCAN_ARG)
%.manyflattenedscan: SHELL=/bin/bash
%.manyflattenedscan: %.flattenedscan.dir
$(SCAN_TIME) for (( i = 0; i < $(BENCH_RUNS); i++ )) ; do $(MAKE) -s $*.flattenedscan SCAN_TIME= "QUIET_SCAN_ARG= >/dev/null" ; done
%.flattenedscan.dir: QUIET_BENCH_ARG=-q
%.flattenedscan.dir: QUIET_SCAN_ARGS=-q
%.flattenedscan.dir: BENCH_TIME=
%.flattenedscan.dir: $(SCANSCAN_TDB) %.benchmark.dir
rm -rf $@
cp -R $*.benchmark.dir $@
./$< --env $@ $(SCANSCAN_ARGS) $(QUIET_SCAN_ARG)
%.flattenedscan: SHELL=/bin/bash
%.flattenedscan: $(SCANSCAN_TDB) %.flattenedscan.dir
$(SCAN_TIME) ./$< --env $@.dir $(SCANSCAN_ARGS)$(QUIET_SCAN_ARG)
.SECONDARY: $(patsubst %,%.flattenedscan.dir, $(DB_TYPES))
.DEFAULT_GOAL=build
TOKUROOT=../../
INCLUDEDIRS=-I. -I.. -I../../include
CFLAGS+=-Werror
ifeq ($(CYGWIN),)
LINK_FILES += $(FT)
else ifneq ($(CC),icc)
LINK_FILES += $(FT)
else ifeq ($(DEBUG),0)
LINK_FILES += $(IPO_FT)
else ifeq ($(DEBUG),)
LINK_FILES += $(IPO_FT)
else
LINK_FILES += $(FT)
endif
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE
ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
endif
# On cygwin do:
# make CYGWIN=cygwin check
# For verbose output do
# make VERBOSE=1
# For very verbose output do
# make VERBOSE=2
# Exclude orthopush-flush until it is fixed.
SRCS=$(sort $(filter-out dir.%.c,$(wildcard *.c)))
REGRESSION_TESTS_RAW = $(patsubst %.c,%,$(SRCS))
EXTRA_ARGS=
# Add in the binaries that must be run in various ways.
BINS_RAW = $(REGRESSION_TESTS_RAW) \
# This line intentially kept commented so I can have a \ on the end of the previous line
# BINS will be defined by adding .exe if appropriate.
CHECKS = \
benchmarktest_256 \
test-assertA \
test-assertB \
$(REGRESSION_TESTS) \
# This line intentially kept commented so I can have a \ on the previous line
#CHECKS will be defined automatically.
build: $(BINS)
check: $(PTHREAD_LOCAL) $(patsubst %,check_%,$(CHECKS))
fastcheck: $(PTHREAD_LOCAL) $(patsubst %,fastcheck_%,$(CHECKS))
fastcheckonlyfail: $(PTHREAD_LOCAL) $(patsubst %,fastcheckonlyfail_%,$(CHECKS))
check_fail:
test 0 = 1 $(SUMMARIZE_CMD)
check_ok:
test 0 = 0 $(SUMMARIZE_CMD)
ifeq ($(TOKU_SKIP_MINICRON),1)
check_minicron-test$(BINSUF):
@echo "SKIPPED TEST $@ (Fails in win64 vm due to timing issues)"
endif
check_benchmark-test$(BINSUF): benchmark-test$(BINSUF);
check_logcursor-fw$(BINSUF): logcursor-fw$(BINSUF);
@echo "$@ must be run manually (needs logs to iterate over)."
check_logcursor-bw$(BINSUF): logcursor-bw$(BINSUF);
@echo "$@ must be run manually (needs logs to iterate over)."
check_benchmarktest_256: benchmark-test$(BINSUF) $(PTHREAD_LOCAL)
$(VGRIND) ./$< $(VERBVERBOSE) --valsize 256 --verify 1 $(SUMMARIZE_CMD)
check_test-assertA: test-assert$(BINSUF) $(PTHREAD_LOCAL)
@# no arguments, should err
$(VGRIND) ./$< > /dev/null 2>&1 ; test $$? = 1 $(SUMMARIZE_CMD)
ifeq ($(OS_CHOICE),windows)
TEST_ASSERT_FAILCODE=134 #Does not use raise(SIGABRT) to fail assert, so will not overwrite 134 with 1.
else
TEST_ASSERT_FAILCODE=1
endif
check_test-assertB: test-assert$(BINSUF) $(PTHREAD_LOCAL)
@# one argument, not "ok" should err
@rm -f test-assert.out
($(VGRIND) ./$< notok) > test-assert.out 2>&1 ; test $$? = $(TEST_ASSERT_FAILCODE) && fgrep failed test-assert.out > /dev/null && rm test-assert.out $(SUMMARIZE_CMD)
check_test-assertC: test-assert$(BINSUF) $(PTHREAD_LOCAL)
check_test-assert$(BINSUF): test-assert$(BINSUF) $(PTHREAD_LOCAL)
@# one argument, "ok" should not error
$(VGRIND) ./$< ok $(SUMMARIZE_CMD)
check_ft_loader-test-merge-files-dbufio: EXTRA_ARGS=-r 8000 -s dir.$@
check_ft_loader-test$(BINSUF): EXTRA_ARGS=dir.$@
check_ft_loader-test-bad-generate$(BINSUF): EXTRA_ARGS=dir.$@
check_ft_loader-test-extractor$(BINSUF): $(patsubst %,check_ft_loader-test-extractor-%, 1 2 3 1a 2a 3a 4a 5a)
true $(SUMMARIZE_CMD)
# the 1,2,3 tests don't use valgrind, the 1a,2a,3a,4a,5a tests use valgrind.
check_ft_loader-test-extractor-1: ft_loader-test-extractor$(BINSUF)
./$< $(VERBVERBOSE) -s -r 1000 --rowsets 1000 --asc dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-2: ft_loader-test-extractor$(BINSUF)
./$< $(VERBVERBOSE) -s -r 1000 --rowsets 1000 --dsc dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-3: ft_loader-test-extractor$(BINSUF)
./$< $(VERBVERBOSE) -s -r 1000 --rowsets 1000 --random dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-1a: ft_loader-test-extractor$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -r 1000 --rowsets 1000 --asc dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-2a: ft_loader-test-extractor$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -r 1000 --rowsets 1000 --dsc dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-3a: ft_loader-test-extractor$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -r 1000 --rowsets 1000 --random dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-4a: ft_loader-test-extractor$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -r 1000 --rowsets 3 --asc dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-5a: ft_loader-test-extractor$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -r 1000 --rowsets 3 --asc --asc-poison dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-errors$(BINSUF): $(patsubst %,check_ft_loader-test-extractor-errors-%, 1 2)
true $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-errors-1: ft_loader-test-extractor-errors$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -w -m -u -r 1 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-extractor-errors-2: ft_loader-test-extractor-errors$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -m -r 10000 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-open$(BINSUF): EXTRA_ARGS=dir_$@
check_ft_loader-test-writer$(BINSUF): $(patsubst %,check_ft_loader-test-writer-%, 1 1000 100000 1000000 1-x 1000-x 100000-x 1000000-x)
true $(SUMMARIZE_CMD)
check_ft_loader-test-writer-1: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 1 -s dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-1000: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 1000 -s dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-100000: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 100000 -s dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-1000000: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 1000000 -s dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-1-x: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 1 -s -x 42 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-1000-x: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 1000 -s -x 42 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-100000-x: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 100000 -s -x 42 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-1000000-x: ft_loader-test-writer$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -r 1000000 -s -x 42 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-errors$(BINSUF): $(patsubst %,check_ft_loader-test-writer-errors-%, 1 2 3 4)
true $(SUMMARIZE_CMD)
check_ft_loader-test-writer-errors-1: ft_loader-test-writer-errors$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -w -m -u -r 100000 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-errors-2: ft_loader-test-writer-errors$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -w -m -u -r 10000 dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-errors-3: ft_loader-test-writer-errors$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -r 20000 --malloc_limit 0 --realloc_errors dir.$@ $(SUMMARIZE_CMD)
check_ft_loader-test-writer-errors-4: ft_loader-test-writer-errors$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) -s -m --malloc_limit 0 -r 10000 dir.$@ $(SUMMARIZE_CMD)
check_ft-serialize-benchmark: brt-serialize-benchmark$(BINSUF)
./$< 92 200000 > /dev/null 2>&1 $(SUMMARIZE_CMD)
check_bnc-insert-benchmark: bnc-insert-benchmark$(BINSUF)
./$< 100 4096000 1000 > /dev/null 2>&1 $(SUMMARIZE_CMD)
check_%: % $(PTHREAD_LOCAL)
$(VGRIND) ./$< $(VERBVERBOSE) $(EXTRA_ARGS) $(SUMMARIZE_CMD)
fastcheck_%: $(PTHREAD_LOCAL)
@(perl -e 'alarm ($(FASTCHECKTIMEOUT) * 60) ; exec @ARGV' $(MAKE) VGRIND= SUMMARIZE=0 check_$*) &>$*.fastlog ; \
if test $$? != 0 ; then \
printf "%-60s FAIL\nexamine %s\n" check_$* $*.fastlog; \
exit 2 ; \
else \
printf "%-60s PASS\n" check_$* ; \
$(RM) $*.fastlog ; \
fi
fastcheckonlyfail_%: $(PTHREAD_LOCAL)
@(perl -e 'alarm ($(FASTCHECKTIMEOUT) * 60) ; exec @ARGV' $(MAKE) VGRIND= SUMMARIZE=0 check_$*) &>$*.fastlog ; \
if test $$? != 0 ; then \
printf "%-60s FAIL\nexamine %s\n" check_$* $*.fastlog; \
exit 2 ; \
else \
$(RM) $*.fastlog ; \
fi
benchmark-test.$(OEXT): ../ft-ops.h ../ft-search.h ../../include/db.h
ft_loader_test$(BINSUF): ../ftloader-internal.h ../ft_loader.o
../ft_loader.$(OEXT): ../ft_loader.c ../ftloader-internal.h
cd $(@D) && $(MAKE) $(@F)
CILKSCREEN=../../scripts/tokucilkscreen
check_ft_loader: check_ft_loader-test-bad-generate check_ft_loader-test-extractor check_ft_loader-test-extractor-errors check_ft_loader-test-merge-files-dbufio check_ft_loader-test-open check_ft_loader-test-writer check_ft_loader-test-writer-errors
cilkscreen_ft_loader-tests: cilkscreen_ft_loader-test-1
true $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-1: ft_loader-test$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-extractor-tests: $(patsubst %,cilkscreen_ft_loader-test-extractor-%, 1 2)
true $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-extractor-1: ft_loader-test-extractor$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-extractor-2: ft_loader-test-extractor$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-extractor-3: ft_loader-test-extractor$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 100 --rowsets 100 dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-writer-tests: $(patsubst %,cilkscreen_ft_loader-test-writer-%, 1000 10000 1000-x 10000-x)
true $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-1: ft_loader-test-writer$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 1 dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-1000: ft_loader-test-writer$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 1000 dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-10000: ft_loader-test-writer$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 10000 dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-1000000: ft_loader-test-writer$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 1000000 dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-1000-x: ft_loader-test-writer$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 1000 -x 42 dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-10000-x: ft_loader-test-writer$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 10000 -x 42 dir.$@ $(SUMMARIZE_CMD)
# this test sometimes crashes cilkscreen 8503, omit for now
cilkscreen_ft_loader-test-writer-3: ft_loader-test-writer$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 100000 dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-writer-error-tests: $(patsubst %,cilkscreen_ft_loader-test-writer-errors-%, 1 2 3 4)
true $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-errors-1: ft_loader-test-writer-errors$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 10000 -u dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-errors-2: ft_loader-test-writer-errors$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 10000 -w dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-errors-3: ft_loader-test-writer-errors$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 10000 -m dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader-test-writer-errors-4: ft_loader-test-writer-errors$(BINSUF)
$(CILKSCREEN) ./$< $(VERBVERBOSE) -s -r 10000 --realloc_errors dir.$@ $(SUMMARIZE_CMD)
cilkscreen_ft_loader: cilkscreen_ft_loader-tests cilkscreen_ft_loader-extractor-tests cilkscreen_ft_loader-writer-tests cilkscreen_ft_loader-writer-error-tests
check_upgrade_test_simple: VGRIND=
check_upgrade_test_simple_with_valgrind: upgrade_test_simple
$(VGRIND) ./$< $(VERBVERBOSE) $(EXTRA_ARGS) $(SUMMARIZE_CMD)
clean:
rm -rf log-test7.c.dir_*
rm -rf *.dir dir.*
rm -f test_oexcl.c.tmp
rm -f *.ft_handle *.clean *.dirty *.tdb *.dat *.data *.out *.check.valgrind *.fastlog
ifeq ($(PROF),1)
$(BINS): LDFLAGS=$(TOKUROOT)lib/libft.$(AEXT) $(LIBPORTABILITY_A) $(ALWAYS_LINK)
else
$(BINS): LDFLAGS=-L../../lib -l$(LIBTOKUPORTABILITY) -lft $(ALWAYS_LINK) -Wl,-rpath,$(shell pwd)/$(TOKUROOT)lib
endif
$(BINS): test.h
foo:
echo $(LDFLAGS)
#test1305 is first, since it is the longest test. Thus reducing the makespan on parallel checks
# Put these one-per-line so that if we insert a new one the svn diff can understand it better.
# Also keep them sorted.
FT_TESTS_RAW = \
test1305 \
block_allocator_test \
bread-test \
ft_loader_open_temp_file \
brt-serialize-test \
brt-serialize-sub-block-test \
brt-test \
brt-test-cursor \
brt-test-cursor-2 \
brt-test0 \
brt-test1 \
brt-test2 \
brt-test3 \
brt-test4 \
brt-test5 \
cachetable-rwlock-test \
cachetable-test \
cachetable-test2 \
cachetable-put-test \
cachetable-getandpin-test \
cachetable-unpin-test \
cachetable-rename-test \
cachetable-fd-test \
cachetable-flush-test \
cachetable-count-pinned-test \
cachetable-debug-test \
cachetable-debug-test \
cachetable-checkpoint-pending \
cachetable-checkpoint-test \
cachetable-prefetch-maybegetandpin-test \
cachetable-prefetch2-test \
cachetable-prefetch-close-test \
cachetable-prefetch-close-fail-test \
cachetable-prefetch-close-leak-test \
cachetable-prefetch-getandpin-test \
cachetable-prefetch-getandpin-fail-test \
cachetable-prefetch-checkpoint-test \
cachetable-reserve-filenum \
fifo-test \
list-test \
keyrange \
keyrange-unflat \
keyrange-dupsort \
keyrange-dupsort-unflat \
keytest \
log-test \
log-test2 \
log-test3 \
log-test4 \
log-test5 \
log-test6 \
log-test7 \
logcursor-timestamp \
logcursor-empty-logdir \
logcursor-empty-logfile \
logcursor-empty-logfile-2 \
memtest \
minicron-test \
omt-cursor-test \
omt-test \
pqueue-test \
recovery-cbegin \
recovery-cbegin-cend \
recovery-cbegin-cend-hello \
recovery-empty \
recovery-fopen-missing-file \
recovery-hello \
recovery-no-datadir \
recovery-no-log \
recovery-no-logdir \
shortcut \
test1308a \
test-assert \
test-brt-delete-both \
test-brt-overflow \
test-del-inorder \
test-inc-split \
test-leafentry10 \
test-leafentry-nested \
test_logcursor \
test_oexcl \
test_toku_malloc_plain_free \
threadpool-test \
workqueue-test \
x1764-test \
ybt-test \
# This line intentially kept commented so I can have a \ on the end of the previous line
# Add in the binaries that must be run in various ways.
FT_TESTS_BINS_RAW = $(FT_TESTS_RAW) \
benchmark-test \
cachetable-scan \
# This line intentially kept commented so I can have a \ on the end of the previous line
# BINS will be defined by adding .exe if appropriate.
FT_TESTS_BINS = $(patsubst %,ft/tests/%$(BINSUF),$(FT_TESTS_BINS_RAW))
# Use the "|" rule to say that these libraries must be built before the executables, but don't rebuild these just because the library gets rebuilt.
$(FT_TESTS_BINS): | lib/libtokuportability.$(SOEXT) ft/libft.$(SOEXT)
$(FT_TESTS_BINS): CPPFLAGS+=-Iinclude -Ift
$(FT_TESTS_BINS): LOADLIBES+=-Lft -lft -Llib -ltokuportability -lz -lpthread
$(FT_TESTS_BINS): LDFLAGS+= -Wl,-rpath,ft -Wl,-rpath,lib
FT_TESTS_CHECKS = \
benchmarktest_256 \
test-assertA \
test-assertB \
$(FT_TESTS_RAW) \
#
FT_TESTS_RUN_CHECKS = $(patsubst %,ft/tests/check_%,$(FT_TESTS_CHECKS))
ft/tests/build: $(FT_TESTS_BINS)
ft/tests/check: $(FT_TESTS_RUN_CHECKS)
ft/tests/check_benchmarktest_256: ft/tests/benchmark-test$(BINSUF) $(PTHREAD_LOCAL)
$(VGRIND) ./$< $(VERBVERBOSE) --valsize 256 --verify 1 $(SUMMARIZE_CMD)
ft/tests/check_test-assertA: ft/tests/test-assert$(BINSUF) $(PTHREAD_LOCAL)
@# no arguments, should err
$(VGRIND) ./$< > /dev/null 2>&1 ; test $$? = 1 $(SUMMARIZE_CMD)
ifeq ($(OS_CHOICE),windows)
TEST_ASSERT_FAILCODE=134 #Does not use raise(SIGABRT) to fail assert, so will not overwrite 134 with 1.
else
TEST_ASSERT_FAILCODE=1
endif
ft/tests/check_test-assertB: ft/tests/test-assert$(BINSUF) $(PTHREAD_LOCAL)
@# one argument, not "ok" should err
@rm -f test-assert.out
($(VGRIND) ./$< notok) > test-assert.out 2>&1 ; test $$? = $(TEST_ASSERT_FAILCODE) && fgrep failed test-assert.out > /dev/null $(SUMMARIZE_CMD)
ft/tests/check_test-assert: ft/tests/test-assert$(BINSUF) $(PTHREAD_LOCAL)
@# one argument, "ok" should not error
$(VGRIND) ./$< ok $(SUMMARIZE_CMD)
ft/tests/check_test1305: VGRIND=
ft/tests/check_%: ft/tests/%$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
ft/tests/ft_loader_open_temp_file.$(OEXT): CPPFLAGS+=-Ift -Iinclude
ft/tests/ft_loader_open_temp_file.$(OEXT): ft/ftloader-internal.h
# -*- Mode: Makefile -*-
.DEFAULT_GOAL=install
TOKUROOT=../
INCLUDEDIRS=-I. -I$(TOKUROOT)/include
include $(TOKUROOT)toku_include/Makefile.include
OPT_AROPT=-qnoipo #Disable ipo for lib creation even when optimization is on.
SRCS = $(wildcard *.c)
OBJS = $(patsubst %.c,%.$(OEXT),$(SRCS))
TARGET = $(LIBPORTABILITY_SO) $(LIBPORTABILITY_A)
local build install: $(TARGET)
ifeq ($(CC),icc)
#LINUX_NOSTDLIB=-nostdlib
LINUX_NOSTDLIB=-static-intel -diag-disable 10237
else
LINUX_NOSTDLIB=
endif
$(LIBPORTABILITY_SO): $(OBJS)
$(CC) -shared $(SYMBOLS) $(OBJS) $(SKIP_WARNING) -o $@ $(LINUX_NOSTDLIB) $(GCOV_FLAGS)
$(LIBPORTABILITY_A): $(OBJS)
$(AR) cr $@ $(OBJS)
$(OBJS): CFLAGS += -DTOKU_ALLOW_DEPRECATED -D_GNU_SOURCE
$(OBJS): VISIBILITY=
#Blank on purpose
check: $(TARGET)
cd tests && $(MAKE) check
clean:
rm -rf $(TARGET)
cd tests && $(MAKE) clean
LIBPORTABILITY = lib/libtokuportability.$(SOEXT)
include linux/tests/make.include
linux/build: $(LIBPORTABILITY) linux/tests/build
LINUX_SRCS = $(wildcard linux/*.c)
LINUX_OBJS = $(patsubst %.c,%.$(OEXT),$(LINUX_SRCS))
$(LINUX_OBJS): CPPFLAGS_DIRECTORY = -Itoku_include -Ilinux
$(LINUX_OBJS): CFLAGS_DIRECTORY = -DTOKU_ALLOW_DEPRECATED
$(LINUX_OBJS): LDFLAGS_DIRECTORY =
$(LINUX_OBJS): LOADLIBES_DIRECTORY =
$(LINUX_OBJS): VISIBILITY=-fvisibility=default
$(LIBPORTABILITY): $(LINUX_OBJS)
$(LIBPORTABILITY): VISIBILITY=-fvisibility=default
$(LIBPORTABILITY): LOADLIBES=
$(LIBPORTABILITY): LDFLAGS=
linux/check: linux/tests/check
# -*- Mode: Makefile -*-
CPPFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CPPFLAGS += -I../../toku_include -I.. -I.
OPTFLAGS = -O0
CFLAGS = -Wall -Werror -g $(OPTFLAGS) -std=c99
ifeq ($(GCCVERSION),4.4.4)
CFLAGS += -Wno-deprecated
else ifeq ($(GCCVERSION),4.4.2)
CFLAGS += -Wno-deprecated
else ifeq ($(GCCVERSION),4.4.1)
CFLAGS += -Wno-deprecated
else ifeq ($(GCCVERSION),4.4.0)
CFLAGS += -Wno-deprecated
endif
ifneq ($(GCOV),)
CFLAGS += -fprofile-arcs -ftest-coverage -DGCOV
endif
LDFLAGS = -L../../lib -Wl,-rpath,../../lib
LIBTOKUPORTABILITY=tokuportability
LDLIBS = -l$(LIBTOKUPORTABILITY) -lpthread -ldl
SRCS=$(sort $(filter-out dir.%.c,$(wildcard *.c)))
TARGETS = $(patsubst %.c,%,$(SRCS))
RUNTARGETS = $(patsubst %,%.tdbrun,$(TARGETS))
VGRIND = valgrind
ifeq ($(CC),icc)
CFLAGS += -diag-disable 981
endif
HERE=linux/tests
ifeq ($(SUMMARIZE),1)
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
SUMMARIZE_SHOULD_FAIL= ;if test $$? = 0; then printf "%-60sXFAIL\n" $(HERE)/$@; else printf "%-60sXPASS\n" $(HERE)/$@ ; test 0 = 1; fi
else
SUMMARIZE_CMD =
endif
INVERTER=;test $$? -ne 0
all: $(TARGETS)
%: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS) -lrt
.PHONY: check build
build: $(TARGETS)
check: $(TARGETS) $(RUNTARGETS);
test-rwlock: OPTFLAGS=-O3
test-rwlock: ../toku_pthread.h
# pwrite4g needs an argument to tell it which directory to write temporary files
test-pwrite4g.tdbrun: TEST_EXTRA_ARGS=.
%.tdbrun: %
ifeq ($(VGRIND),)
./$< $(TEST_EXTRA_ARGS) $(SUMMARIZE_CMD)
else
$(VGRIND) --error-exitcode=1 --suppressions=../../ft/valgrind.suppressions --quiet --leak-check=full --show-reachable=yes --log-file=$<.check.valgrind ./$< $(TEST_EXTRA_ARGS) >$<.check.output 2>&1; \
if [ $$? = 0 ] ; then \
lines=`cat $<.check.valgrind | wc -l`; \
if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \
else \
cat $<.check.valgrind; test 0 = 1; \
fi \
$(SUMMARIZE_CMD)
endif
# check to see if that logic makes an error when there is a leak.
try-leak-lost.tdbrun: try-leak-lost
ifeq ($(VGRIND),)
./$< $(SUMMARIZE_SHOULD_FAIL)
else
$(VGRIND) --error-exitcode=1 --suppressions=../../ft/valgrind.suppressions --quiet --leak-check=full --show-reachable=yes --log-file=$<.check.valgrind ./$< >$<.check.output 2>&1; \
if [ $$? = 0 ] ; then \
lines=`cat $<.check.valgrind | wc -l`; \
if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \
else \
test 0 = 1; \
fi \
$(INVERTER) \
$(SUMMARIZE_SHOULD_FAIL)
endif
try-leak-reachable.tdbrun: try-leak-reachable
ifeq ($(VGRIND),)
./$< $(SUMMARIZE_SHOULD_FAIL)
else
$(VGRIND) --error-exitcode=1 --suppressions=../../ft/valgrind.suppressions --quiet --leak-check=full --show-reachable=yes --log-file=$<.check.valgrind ./$< >$<.check.output 2>&1; \
if [ $$? = 0 ] ; then \
lines=`cat $<.check.valgrind | wc -l`; \
if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \
else \
test 0 = 1; \
fi \
$(INVERTER) \
$(SUMMARIZE_SHOULD_FAIL)
endif
try-uninit.tdbrun: try-uninit
ifeq ($(VGRIND),)
./$< $(SUMMARIZE_SHOULD_FAIL)
else
$(VGRIND) --error-exitcode=1 --suppressions=../../ft/valgrind.suppressions --quiet --leak-check=full --show-reachable=yes --log-file=$<.check.valgrind ./$< >$<.check.output 2>&1; \
if [ $$? = 0 ] ; then \
lines=`cat $<.check.valgrind | wc -l`; \
if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \
else \
test 0 = 1; \
fi \
$(INVERTER) \
$(SUMMARIZE_SHOULD_FAIL)
endif
try-assert0.tdbrun: try-assert0
./$< 2> /dev/null $(INVERTER) $(SUMMARIZE_SHOULD_FAIL)
try-assert-zero.tdbrun: try-assert-zero
./$< 2> /dev/null $(INVERTER) $(SUMMARIZE_SHOULD_FAIL)
clean:
rm -rf $(TARGETS) *.check.output *.check.valgrind pwrite4g.data testdir dir.*.c
try-assert0.tdbrun:
check_memory_status: test-memory-status
./test-memory-status
LD_PRELOAD=../../../../mysql/jemalloc-2.2.5/lib/libjemalloc.so ./test-memory-status
foo:
echo $(TARGETS)
LINUX_TESTS_SRCS = $(wildcard linux/tests/test-*.c)
LINUX_TESTS_TARGETS = $(patsubst %.c,%,$(LINUX_TESTS_SRCS))
LINUX_TESTS_RUNTARGETS = $(patsubst %,%.tdbrun,$(LINUX_TESTS_TARGETS))
linux/tests/build: $(LINUX_TESTS_TARGETS)
linux/tests/check: $(LINUX_TESTS_RUNTARGETS)
$(LINUX_TESTS_TARGETS): | $(LIBPORTABILITY)
# Every directory must define these rules for its make rules. And not with +=
linux/tests/%: CFLAGS_DIRECTORY =
linux/tests/%: CPPFLAGS_DIRECTORY = -Itoku_include -Ilinux -Ilinux/tests
linux/tests/%: LOADLIBES_DIRECTORY = -Llib -ltokuportability -lpthread
linux/tests/test-pwrite4g.tdbrun: TEST_EXTRA_ARGS=linux/tests
linux/tests/%.tdbrun: linux/tests/%
$(VGRIND) ./$< $(TEST_EXTRA_ARGS) $(SUMMARIZE_CMD)
linux/tests/test-gettime: LOADLIBES += -lrt
linux/tests/foo:
echo $(VGRIND)
# -*- Mode: Makefile -*-
.DEFAULT_GOAL=build
TOKUROOT=../
INCLUDEDIRS=-I$(TOKUROOT)ft -I../include -I./lock_tree -I./range_tree
DEPEND_COMPILE += \
ydb-internal.h \
$(TOKUROOT)include/db.h \
$(TOKUROOT)ft/cachetable.h \
$(TOKUROOT)ft/ft-ops.h \
#End of line
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE -D_THREAD_SAFE
ifeq ($(PROF),1)
LIBRARY=../lib/lib$(LIBTOKUDB).$(AEXT)
else
LIBRARY=../lib/lib$(LIBTOKUDB).$(SOEXT)
endif
OBJS_RAW = \
ydb_lib \
ydb \
ydb_cursor \
ydb_row_lock \
ydb_env_func \
ydb_write \
ydb_db \
ydb_txn \
errors \
loader \
indexer \
indexer-undo-do \
elocks \
#\end
#OBJS automatically defined.
loader.$(OEXT): $(LOG_HEADER)
ydb.$(OEXT): $(LOG_HEADER)
LIBRARIES=
LIBRARIES+= \
$(LIBRARY) \
#Purposely here for \ at end of prev
ifeq ($(OS_CHOICE),windows)
#Does not support parallel builds for files in src.
.NOTPARALLEL:;
#Do not build the dynamic libraries.
LIBRARIES=
ifeq ($(DEBUG),0)
WINYDB = $(IPO_YDB)
else
WINYDB = $(NOIPO_YDB)
endif
LIBRARIES += $(WINYDB)
libtokudb.pdb : $(WINYDB);
endif
.PHONY: build local build_tests
build: local build_tests ;
local: buildlocktrees libs ;
build_tests: | local
cd tests && $(MAKE) build
.PHONY: local libs buildlocktrees
libs: $(LIBRARIES) ;
#Generate export.def
#Take everything from export.map, add snprintf and vsnprintf, and then convert into export.def format.
export.def: export.map Makefile
echo "EXPORTS" > $@
cat export.map | sed 's/global:$$/global:\n snprintf;\n usleep;/' | sed -n "s/\([a-zA-Z_0-9][a-zA-Z_0-9]*\);/\t\1 @/g;/@/ P" |sort | sed -n 'P;=' | sed '{;N;s/\n//;}' >> $@
echo "" >> $@
buildlocktrees: $(LOCKTREE) $(RANGETREE) ;
$(LIBRARY): $(OBJS) $(LOCKTREE) $(RANGETREE) ../lib/libft.a $(DEPEND_COMPILE) $(DEPEND_LINK)
$(LIBRARY): LINK_FILES=$(OBJS) $(LOCKTREE) $(RANGETREE) ../lib/libft.a $(LZMA_A)
ifeq ($(CC),icc)
ifeq ($(HAVE_CILK),1)
ifeq (0,0)
$(LIBRARY): LINK_FILES+=$(wildcard ../cilk_icc/*.o)
else
$(LIBRARY): LINK_FILES+=-lcilkrts
endif
endif
endif
check_globals: lib$(LIBTOKUDB).$(SOEXT)
python tokuglobals.py $<
.PHONY: check_tests
check_tests: build_tests
cd tests && $(MAKE) check
.PHONY: check
check: local check_globals check_tests
.PHONY: strip
strip: $(LIBRARY)
strip $<
clean:
rm -f export.def
cd tests && $(MAKE) clean
cd lock_tree && $(MAKE) clean
cd range_tree && $(MAKE) clean
LOCKTREE_FILES = db_id rth lth idlth locktree
LOCKTREE_HERE = $(ROOT)src/lock_tree
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= build
TOKUROOT=../../
INCLUDEDIRS=-I. -I$(TOKUROOT)ft -I../range_tree -I$(TOKUROOT)src
DEPEND_COMPILE+= \
*.h \
../range_tree/*.h \
#end
SKIP_LOCKTREERULE=1
include $(TOKUROOT)toku_include/Makefile.include
LOCKTREE = locktree.$(AEXT)
LOCKTREE_LINEAR = locktree_linear.$(AEXT)
LOCKTREE_TLOG = locktree_tlog.$(AEXT)
LOCKTREE_LOG = locktree_log.$(AEXT)
OBJS_RAW = \
idlth \
lth \
rth \
txnid_set \
wfg \
#end
LIBRARIES=$(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE) # $(LOCKTREE_LOG)
$(LOCKTREE_TLOG): $(OBJS) locktree_nooverlap.$(OEXT)
$(LOCKTREE_LOG) $(LOCKTREE_LINEAR): $(OBJS) locktree.$(OEXT)
locktree.$(OEXT) locktree_nooverlap.$(OEXT) $(OBJS): CPPFLAGS+=-I$(TOKUROOT)include
$(LOCKTREE): $(LOCKTREE_TLOG)
cp $< $@
.PHONY: build local check
build local: $(LIBRARIES)
locktree_nooverlap.$(OEXT): CPPFLAGS+=-DTOKU_RT_NOOVERLAPS
locktree_nooverlap.$(OEXT): locktree.c $(DEPEND_COMPILE)
$(CC) $< -c $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
build check clean:
cd tests;$(MAKE) $@
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= build
TOKUROOT=../../../
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)ft -I$(TOKUROOT)src/range_tree -I$(TOKUROOT)include
DEPEND_COMPILE += \
../*.h \
test.h \
#end
DEPEND_COMPILE+= $(FT)
include $(TOKUROOT)toku_include/Makefile.include
LDLIBS+=-lft -ltokuportability
LDFLAGS+=-L$(TOKUROOT)lib -Wl,-rpath,$(shell pwd)/$(TOKUROOT)lib
ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
endif
SRCS = $(wildcard *.c)
LOG_TESTS = $(patsubst %.c,%.log$(BINSUF),$(SRCS))
TLOG_TESTS = $(patsubst %.c,%.tlog$(BINSUF),$(SRCS))
LIN_TESTS = $(patsubst %.c,%.lin$(BINSUF),$(SRCS))
WFG_TESTS = $(patsubst %.c,%.lin$(BINSUF), $(wildcard test_wfg*.c))
ALL_TESTS = $(LIN_TESTS) $(TLOG_TESTS) #$(LOG_TESTS)
RUN_LOG_TESTS = $(patsubst %.log$(BINSUF),%.logrun,$(LOG_TESTS))
RUN_TLOG_TESTS = $(patsubst %.tlog$(BINSUF),%.tlogrun,$(TLOG_TESTS))
RUN_LIN_TESTS = $(patsubst %.lin$(BINSUF),%.linrun,$(LIN_TESTS))
RUN_ALL_TESTS = $(RUN_LIN_TESTS) $(RUN_TLOG_TESTS) #$(RUN_LOG_TESTS)
RUN_WFG_TESTS = $(patsubst %.lin$(BINSUF),%.linrun,$(WFG_TESTS))
.PHONY: default all check tests check.lin check.tlog check.log tests.lin tests.log tests.tlog
default all build: $(ALL_TESTS)
check: $(RUN_ALL_TESTS)
tests: $(ALL_TESTS)
tests.lin: $(LIN_TESTS)
check.lin: $(RUN_LIN_TESTS)
tests.tlog: $(TLOG_TESTS)
check.tlog: $(RUN_TLOG_TESTS)
tests.log: $(LOG_TESTS)
check.log: $(RUN_LOG_TESTS)
check.wfg: $(RUN_WFG_TESTS)
.PHONY: %.linrun %.logrun %.run %.tlogrun
# STUFF!!!!
%.run: %.linrun %.tlogrun #%.logrun
%.linrun: %.lin$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
%.tlogrun: %.tlog$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
%.logrun: %.log$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
A_LINEAR=$(LOCKTREE_LINEAR) $(RANGETREE_LINEAR)
A_TLOG =$(LOCKTREE_TLOG) $(RANGETREE_TLOG)
A_LOG =$(LOCKTREE_LOG) $(RANGETREE_LOG)
%.lin$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(A_LINEAR)
$(CC) -DTESTDIR=\"dir.$<.lin\" $< $(A_LINEAR) $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
%.tlog$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(A_TLOG)
$(CC) -DTESTDIR=\"dir.$<.tlog\" $< $(A_TLOG) $(BIN_FROM_C_FLAGS) -DTOKU_RT_NOOVERLAPS $(LINK_MUST_BE_LAST)
%.log$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(A_LOG)
$(CC) -DTESTDIR=\"dir.$<.log\" $< $(A_LOG) $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
clean:
rm -f $(ALL_TESTS)
rm -rf dir.*.lin dir.*.tlog dir.*.log
check_footprint.linrun: check_footprint_point.linrun check_footprint_range.linrun
true
check_footprint_point.linrun: test_footprint_point_write.lin
$(VGRIND) ./$< -v --nrows 1 && \
$(VGRIND) ./$< -v --nrows 2 && \
$(VGRIND) ./$< -v --nrows 10 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 100 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 1000 --max_locks 1000
check_footprint_range.linrun: test_footprint_range_write.lin
$(VGRIND) ./$< -v --nrows 1 && \
$(VGRIND) ./$< -v --nrows 2 && \
$(VGRIND) ./$< -v --nrows 10 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 100 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 1000 --max_locks 1000
check_footprint.tlogrun: check_footprint_point.tlogrun check_footprint_range.tlogrun
true
check_footprint_point.tlogrun: test_footprint_point_write.tlog
$(VGRIND) ./$< -v --nrows 1 && \
$(VGRIND) ./$< -v --nrows 2 && \
$(VGRIND) ./$< -v --nrows 10 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 100 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 1000 --max_locks 1000
check_footprint_range.tlogrun: test_footprint_range_write.tlog
$(VGRIND) ./$< -v --nrows 1 && \
$(VGRIND) ./$< -v --nrows 2 && \
$(VGRIND) ./$< -v --nrows 10 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 100 --max_locks 1000 && \
$(VGRIND) ./$< -v --nrows 1000 --max_locks 1000
RANGETREE_FILES = log_nooverlap
RANGETREE_HERE = $(ROOT)src/range_tree
RANGETREE_HEADERS = rangetree rangetree-internal
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= build
TOKUROOT=../../
INCLUDEDIRS=-I. -I$(TOKUROOT)ft
DEPEND_COMPILE+= \
*.h \
#end
SKIP_RANGETREERULE=1
include $(TOKUROOT)toku_include/Makefile.include
RANGETREE = rangetree.$(AEXT)
RANGETREE_LINEAR = rangetree_linear.$(AEXT)
RANGETREE_TLOG = rangetree_tlog.$(AEXT)
RANGETREE_LOG = rangetree_log.$(AEXT)
#This line is so we can have a \ at the end of the previous.
RANGETREE =rangetree.$(AEXT)
LIBRARIES=$(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE) # $(RANGETREE_LOG)
$(RANGETREE_TLOG): log_nooverlap.$(OEXT)
$(RANGETREE_LINEAR): linear.$(OEXT)
$(RANGETREE_LOG): log.$(OEXT)
$(RANGETREE_TLOG) $(RANGETREE_LINEAR) $(RANGETREE_LOG): CPPFLAGS+=-I$(TOKUROOT)include
$(RANGETREE): $(RANGETREE_TLOG)
cp $< $@
.PHONY: build check
build: $(LIBRARIES)
build check clean:
cd tests;$(MAKE) $@
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= build
TOKUROOT=../../../
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)ft
DEPEND_COMPILE+=../rangetree.h ../rangetree-internal.h test.h
DEPEND_COMPILE+=$(FT_SO)
include $(TOKUROOT)toku_include/Makefile.include
LDLIBS+=-lft -ltokuportability
LDFLAGS+=-L$(TOKUROOT)lib -Wl,-rpath,$(shell pwd)/$(TOKUROOT)lib
ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
endif
SRCS = $(wildcard *.c)
LOG_TESTS = $(patsubst %.c,%.log$(BINSUF),$(SRCS))
TLOG_TESTS = $(patsubst %.c,%.tlog$(BINSUF),$(SRCS))
LIN_TESTS = $(patsubst %.c,%.lin$(BINSUF),$(SRCS))
ALL_TESTS = $(LIN_TESTS) $(TLOG_TESTS) #$(LOG_TESTS)
$(ALL_TESTS): CPPFLAGS+=-I$(TOKUROOT)include
RUN_LOG_TESTS = $(patsubst %.log$(BINSUF),%.logrun,$(LOG_TESTS))
RUN_TLOG_TESTS = $(patsubst %.tlog$(BINSUF),%.tlogrun,$(TLOG_TESTS))
RUN_LIN_TESTS = $(patsubst %.lin$(BINSUF),%.linrun,$(LIN_TESTS))
RUN_ALL_TESTS = $(RUN_LIN_TESTS) $(RUN_TLOG_TESTS) #$(RUN_LOG_TESTS)
.PHONY: default all check tests check.lin check.tlog check.log tests.lin tests.log tests.tlog
default all build: $(ALL_TESTS)
check: $(RUN_ALL_TESTS)
tests: $(ALL_TESTS)
tests.lin: $(LIN_TESTS)
check.lin: $(RUN_LIN_TESTS)
tests.tlog: $(TLOG_TESTS)
check.tlog: $(RUN_TLOG_TESTS)
tests.log: $(LOG_TESTS)
check.log: $(RUN_LOG_TESTS)
.PHONY: %.linrun %.logrun %.run %.tlogrun
# STUFF!!!!
%.run: %.linrun %.tlogrun #%.logrun
%.linrun: %.lin$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
%.tlogrun: %.tlog$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
%.logrun: %.log$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
A_LINEAR=$(RANGETREE_LINEAR)
A_TLOG =$(RANGETREE_TLOG)
A_LOG =$(RANGETREE_LOG)
%.lin$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(A_LINEAR)
$(CC) -DTESTDIR=\"dir.$<.lin\" $< $(A_LINEAR) $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
%.tlog$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(A_TLOG)
$(CC) -DTESTDIR=\"dir.$<.tlog\" $< $(A_TLOG) $(BIN_FROM_C_FLAGS) -DTOKU_RT_NOOVERLAPS $(LINK_MUST_BE_LAST)
%.log$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(A_LOG)
$(CC) -DTESTDIR=\"dir.$<.log\" $< $(A_LOG) $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
clean:
rm -f $(ALL_TESTS)
rm -rf dir.*.lin dir.*.tlog dir.*.log
ROOT = ../../
build default: src/tests.builddir
check: src/tests.checkdir
include $(ROOT)Makefile.include
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= build
TOKUROOT=../../
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)ft -I../range_tree -I../lock_tree
DEPEND_COMPILE += \
../*.h \
../range_tree/*.h \
../lock_tree/*.h \
test.h \
#end
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE
ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
endif
BDBVGRIND=
TDB_EXTRA_NEEDED=
ifeq ($(OS_CHOICE),windows)
LIBTDB=$(WIN_YDB)
%.tdb$(BINSUF): $(WIN_YDB)
%.tdb$(BINSUF): LINK_FILES+=$(WIN_YDB)
TDB_EXTRA_NEEDED=$(WIN_YDB)
else
ifeq ($(PROF),1)
LIBTDB=../../lib/lib$(LIBTOKUDB).$(AEXT)
STATIC_LIBS_NEEDED= \
../ydb_lib.$(OEXT) \
$(LIBTDB) \
$(LOCKTREE) \
$(RANGETREE) \
../../lib/libft.$(AEXT) \
# last line
TLIBTDB=../libtokudbtrace.$(SOEXT)
%.tdb$(BINSUF): LINK_FILES+=$(STATIC_LIBS_NEEDED)
%.tdb$(BINSUF): RPATH_DIRS+=$(TOKUROOT)/lib
else
LIBTDB=../../lib/lib$(LIBTOKUDB).$(SOEXT)
TLIBTDB=../libtokudbtrace.$(SOEXT)
%.tdb$(BINSUF): DLINK_FILES+=$(LIBTDB)
%.tdb$(BINSUF): RPATH_DIRS+=$(patsubst %/,%,$(dir $(LIBTDB)))
endif
endif
RECOVER_SRCS = $(wildcard recover-*.c)
LOADER_SRCS = $(wildcard loader-*.c)
TRANSPARENT_UPGRADE_SRCS = $(wildcard upgrade*.c)
NONSTANDARD_SRCS= \
$(RECOVER_SRCS) \
$(LOADER_SRCS) \
FAIL3312C_SRCS = test3529.c diskfull.c
#SRCS = $(sort $(wildcard *.c))
# To patch out upgrade tests, replace line above with line below,
# and patch out loader-stress-test3 (see below)
#SRCS = $(sort $(filter-out $(TRANSPARENT_UPGRADE_SRCS),$(wildcard *.c)))
# To patch out tests failing on 3312c branch (including upgrade tests), use this:
SRCS = $(sort $(filter-out $(TRANSPARENT_UPGRADE_SRCS),$(filter-out $(FAIL3312C_SRCS),$(wildcard *.c))))
#end
#Tests that don't compile in windows. SHould
WINDOWS_NOT_PORTED_TESTS = \
diskfull \
#\ ends prev line
#Tests that are irrelevant in windows.
WINDOWS_DONTRUN_TESTS = \
$(WINDOWS_NOT_PORTED_TESTS) \
helgrind1 \
helgrind2 \
helgrind3 \
#\ ends prev line
#BDB Tests that are irrelevant in windows.
WINDOWS_BDB_DONTRUN_TESTS = \
diskfull \
test_groupcommit_count \
test_set_func_malloc \
#\ ends prev line
#diskfull: windows bdb is missing db_env_set_func_pwrite and db_env_set_func_write
#test_groupcommit_count: windows bdb is missing db_env_set_func_fsync
#test_set_func_malloc: windows bdb (some) are missing db_env_set_func_(malloc|realloc|free)
#These tests fail, but sometimes they hang! (in windows). Just disable them.
WINDOWS_BDB_DONTRUN_TESTS += \
test_error \
#\ ends prev line
TDB_DONTRUN_SRCS = \
$(wildcard bdb-simple-deadlock*.c) \
TDB_DONTRUN_TESTS = $(patsubst %.c,%,$(TDB_DONTRUN_SRCS))
ifeq ($(OS_CHOICE),windows)
TDB_BINS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(SRCS)))
TDB_TESTS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(filter-out $(NONSTANDARD_SRCS),$(SRCS))))
else
TDB_BINS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(TDB_DONTRUN_SRCS),$(SRCS)))
TDB_TESTS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(NONSTANDARD_SRCS),$(filter-out $(TDB_DONTRUN_SRCS),$(SRCS))))
endif
# For diskfull.bdb: db-4.6 seems OK, but db-4.3 segfaults
BDB_DONTRUN_TESTS = \
backwards_10_each_le_and_msg \
blocking-prelock-range \
blocking-set-range-reverse-0 \
blocking-table-lock \
bug1381 \
bug627 \
cachetable-race \
checkpoint_1 \
checkpoint_callback \
checkpoint_stress \
checkpoint_truncate_1 \
cursor-isolation \
cursor-set-del-rmw \
cursor-set-range-rmw \
db-put-simple-deadlock \
del-simple \
del-multiple \
del-multiple-huge-primary-row \
del-multiple-srcdb \
directory_lock \
diskfull \
env-put-multiple \
env_startup \
execute-updates \
filesize \
helgrind1 \
helgrind2 \
helgrind3 \
hotindexer-bw \
hotindexer-db-busy \
hotindexer-error-callback \
hotindexer-insert-committed-optimized \
hotindexer-insert-committed \
hotindexer-insert-provisional \
hotindexer-lock-test \
hotindexer-multiclient \
hotindexer-nested-insert-committed \
hotindexer-put-abort \
hotindexer-put-commit \
hotindexer-put-multiple \
hotindexer-simple-abort \
hotindexer-undo-do-test \
hotindexer-with-queries \
hot-optimize-table-tests \
insert-dup-prelock \
isolation \
isolation-read-committed \
keyrange \
keyrange-merge \
last-verify-time \
loader-cleanup-test \
loader-create-abort \
loader-create-close \
loader-db-busy \
loader-dup-test \
loader-no-puts \
loader-reference-test \
loader-stress-del \
loader-stress-test \
loader-tpch-load \
lock-pressure \
manyfiles \
maxsize-for-loader \
multiprocess \
mvcc-create-table \
mvcc-many-committed \
perf_checkpoint_var \
perf_cursor_nop \
perf_malloc_free \
perf_nop \
perf_ptquery \
perf_ptquery2 \
perf_xmalloc_free \
prelock-read-read \
prelock-read-write \
prelock-write-read \
prelock-write-write \
print_engine_status \
powerfail \
preload-db \
preload-db-nested \
progress \
put-multiple \
queries_with_deletes \
recover-2483 \
recover-3113 \
recover-compare-db \
recover-compare-db-descriptor \
recover-del-multiple \
recover-del-multiple-abort \
recover-del-multiple-srcdb-fdelete-all \
recover-delboth-after-checkpoint \
recover-delboth-checkpoint \
recover-descriptor \
recover-descriptor2 \
recover-descriptor3 \
recover-descriptor4 \
recover-descriptor5 \
recover-descriptor6 \
recover-descriptor7 \
recover-descriptor8 \
recover-descriptor9 \
recover-descriptor10 \
recover-descriptor11 \
recover-descriptor12 \
recover-fclose-in-checkpoint \
recover-fcreate-basementnodesize \
recover-flt1 \
recover-flt2 \
recover-flt3 \
recover-flt4 \
recover-flt5 \
recover-flt6 \
recover-flt7 \
recover-flt8 \
recover-flt9 \
recover-flt10 \
recover-loader-test \
recover-lsn-filter-multiple \
recover-put-multiple \
recover-put-multiple-abort \
recover-put-multiple-fdelete-all \
recover-put-multiple-fdelete-some \
recover-put-multiple-srcdb-fdelete-all \
recover-split-checkpoint \
recover-tablelock \
recover-test-logsuppress \
recover-test-logsuppress-put \
recover-test_stress1 \
recover-test_stress2 \
recover-test_stress3 \
recover-upgrade-db-descriptor-multihandle \
recover-upgrade-db-descriptor \
recover-update-multiple \
recover-update-multiple-abort \
recover-update_aborts \
recover-update_aborts_before_checkpoint \
recover-update_aborts_before_close \
recover-update_changes_values \
recover-update_changes_values_before_checkpoint \
recover-update_changes_values_before_close \
recover-update_broadcast_aborts \
recover-update_broadcast_aborts2 \
recover-update_broadcast_aborts3 \
recover-update_broadcast_aborts_before_checkpoint \
recover-update_broadcast_aborts_before_close \
recover-update_broadcast_changes_values \
recover-update_broadcast_changes_values2 \
recover-update_broadcast_changes_values3 \
recover-update_broadcast_changes_values_before_checkpoint \
recover-update_broadcast_changes_values_before_close \
recover-update_changes_values_before_close \
recovery_fileops_stress \
recovery_fileops_unit \
recovery_stress \
redirect \
replace-into-write-lock \
root_fifo_2 \
root_fifo_32 \
root_fifo_41 \
shutdown-3344 \
stat64 stat64-create-modify-times stat64_flatten stat64-null-txn stat64-root-changes \
stress-gc \
test-xa-prepare \
test1324 \
test1426 \
test1572 \
test3219 \
test3522 \
test3522b \
test938c \
test_3645 \
test_3529_insert_2 \
test_3529_table_lock \
test_3755 \
test_4015 \
test_4368 \
test_4657 \
test_abort1 \
test_abort4 \
test_abort5 \
test_blobs_leaf_split \
test_bulk_fetch \
test_compression_methods \
test_cmp_descriptor \
test_cursor_delete_2119 \
test_db_descriptor \
test_db_descriptor_named_db \
test_db_txn_locks_read_uncommitted \
test_dupsort_get_both_range_reverse \
test_dupsort_set_range_reverse \
test_get_max_row_size \
test_large_update_broadcast_small_cachetable \
test_logflush \
test_multiple_checkpoints_block_commit \
test_query \
test_rand_insert_mult_db \
test_redirect_func \
test_row_size_supported \
test_stress1 \
test_stress2 \
test_stress3 \
test_stress4 \
test_stress5 \
test_stress6 \
test_stress7 \
test_stress_with_verify \
test_transactional_descriptor \
test_trans_desc_during_chkpt \
test_trans_desc_during_chkpt2 \
test_trans_desc_during_chkpt3 \
test_trans_desc_during_chkpt4 \
test_txn_abort6 \
test_txn_abort8 \
test_txn_abort9 \
test_txn_close_open_commit \
test_txn_commit8 \
test_txn_nested1 \
test_txn_nested2 \
test_txn_nested3 \
test_txn_nested4 \
test_txn_nested5 \
test_update_abort_works \
test_update_calls_back \
test_update_can_delete_elements \
test_update_changes_values \
test_update_nonexistent_keys \
test_update_previously_deleted \
test_update_stress \
test_update_txn_snapshot_works_concurrently \
test_update_txn_snapshot_works_correctly_with_deletes \
test_update_broadcast_abort_works \
test_update_broadcast_calls_back \
test_update_broadcast_can_delete_elements \
test_update_broadcast_changes_values \
test_update_broadcast_previously_deleted \
test_update_broadcast_stress \
test_update_broadcast_update_fun_has_choices \
test_update_broadcast_with_empty_table \
test_update_broadcast_indexer \
test_update_broadcast_loader \
test_update_broadcast_nested_updates \
test_update_nested_updates \
test_update_with_empty_table \
txn-ignore \
transactional_fileops \
update-multiple-data-diagonal \
update-multiple-key0 \
update-multiple-nochange \
update-multiple-with-indexer \
update \
upgrade_simple \
upgrade-test-1 \
upgrade-test-2 \
upgrade-test-3 \
upgrade-test-4 \
upgrade-test-5 \
upgrade-test-6 \
upgrade-test-7 \
zombie_db \
#\ ends prev line
# checkpoint tests depend on this header file,
checkpoint_1.tdb$(BINSUF) checkpoint_stress.tdb$(BINSUF): checkpoint_test.h
# dependency only, not a rule (do not insert a tab at this line)
DEPENDS_ON_STRESS_HELPERS = \
perf_checkpoint_var \
perf_cursor_nop \
perf_malloc_free \
perf_nop \
perf_ptquery2 \
perf_ptquery \
perf_xmalloc_free \
perf_checkpoint_var \
recover-flt1 \
recover-flt2 \
recover-flt3 \
recover-flt4 \
recover-flt5 \
recover-flt6 \
recover-flt7 \
recover-flt8 \
recover-test_stress1 \
recover-test_stress2 \
test_stress1 \
test_stress2 \
test_stress3 \
test_stress4 \
test_stress5 \
test_stress6 \
test_stress7 \
#blank
$(patsubst %,%.tdb,$(DEPENDS_ON_STRESS_HELPERS)): threaded_stress_test_helpers.h
BDB_TESTS_THAT_SHOULD_FAIL= \
#\ ends prev line
ifeq ($(OS_CHOICE),windows)
#The following are nondeterministic test failures or hangs in windows. Just get rid of them in BDB. (for now)
WINDOWS_BDB_DONTRUN_TESTS += \
test_archive2 \
test_cursor_delete \
test_cursor_stickyness \
test_db_dbt_mem_behavior \
test_dup_insert \
test_dup_search \
test_dupsort_get \
test_dupsort_set \
test_unused_memory_crash \
test_dupsort_get_both_range \
test_reverse_compare_fun \
test-recover3 \
#\ ends prev line
endif
ifeq ($(OS_CHOICE),windows)
BDB_DONTRUN_TESTS+=$(WINDOWS_BDB_DONTRUN_TESTS)
endif
ifeq ($(OS_CHOICE),windows)
BDB_TESTS=
BDB_BINS=
else
BDB_TESTS = $(patsubst %.c,%.bdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(BDB_DONTRUN_TESTS)),$(SRCS)))
BDB_BINS = $(patsubst %.c,%.bdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(BDB_DONTRUN_TESTS)),$(SRCS)))
endif
TDB_TESTS_THAT_SHOULD_FAIL= \
test_truncate_txn_abort \
test_db_no_env \
#\ ends prev line
#ifneq ($(OS_CHOICE),windows)
# TDB_TESTS_THAT_SHOULD_FAIL+= \
#\ ends prev line
#endif
TDB_TESTS_THAT_SHOULD_FAIL_LIT= \
test_log8.recover \
test_log9.recover \
test_log10.recover \
recover-missing-dbfile.abortrecover \
recover-missing-dbfile-2.abortrecover \
recover-missing-dbfile-2.abortrecover \
recover-dbopen-eclose.abortrecover \
loader-tpch-load.loader \
#\ ends prev line
ifeq ($(OS_CHOICE),windows)
#Tests that fail in windows but shouldn't. TODO: Fix each one of these and remove from the list!
WIN_IGNORE_TDB_TESTS_THAT_SHOULD_FAIL += \
#\ ends prev line
WIN_IGNORE_TDB_TESTS_THAT_SHOULD_FAIL_LIT += \
#\ ends prev line
endif
ALL_TESTS = $(TDB_TESTS)
#Skip all BDB tests for CYGWIN+ICC
ifeq ($(CYGWIN),)
ALL_TESTS += $(BDB_TESTS)
else ifneq ($(CC),icc)
ALL_TESTS += $(BDB_TESTS)
endif
TLRECOVER = 2 3 4 5 6 7 8 9 10
EXTRA_TDB_TESTS = \
$(patsubst %,test_log%.recover,$(TLRECOVER)) \
test_groupcommit_count_hgrind.tdbrun \
test_groupcommit_count_vgrind.tdbrun \
test_4015.drdrun \
#\ ends prev line
ifeq ($(OS_CHOICE),windows)
EXTRA_TDB_TESTS = \
$(patsubst %,test_log%.recover,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(TLRECOVER))) \
#\ ends prev line
endif
RECOVER_TESTS = $(patsubst %.c,%.abortrecover,$(RECOVER_SRCS))
LOADER_TESTS = $(patsubst %.c,%.loader,$(LOADER_SRCS))
ifeq ($(OS_CHOICE),windows)
RECOVER_TESTS = $(patsubst %.c,%.abortrecover,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(RECOVER_SRCS)))
LOADER_TESTS = $(patsubst %.c,%.loader,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(LOADER_SRCS)))
endif
RUN_TDB_TESTS = $(patsubst %.tdb$(BINSUF),%.tdbrun,$(TDB_TESTS)) $(EXTRA_TDB_TESTS) $(RECOVER_TESTS) $(LOADER_TESTS)
RUN_BDB_TESTS = $(patsubst %.bdb$(BINSUF),%.bdbrun,$(BDB_TESTS))
RUN_ALL_TESTS = $(RUN_BDB_TESTS) $(RUN_TDB_TESTS)
MORE_BDB_BINS = test1426.bdb$(BINSUF)
ALL_BINS = $(TDB_BINS) $(BDB_BINS) $(MORE_BDB_BINS)
.PHONY: default all check tests check.lin check.tlog check.log tests.lin tests.log tests.tlog
default all build: $(ALL_BINS)
ifndef TOKUDBONLY
MAYBE_CHECK_BDB = check.bdb
else
MAYBE_CHECK_BDB =
endif
check: check.tdb $(MAYBE_CHECK_BDB) ;
tests: tests.bdb tests.tdb ;
tests.bdb: $(BDB_BINS) ;
check.bdb: $(RUN_BDB_TESTS) ;
tests.tdb: $(TDB_BINS) ;
check.tdb: $(LIBTDB) $(PTHREAD_LOCAL) $(RUN_TDB_TESTS) ;
check.tdb.extra: $(EXTRA_TDB_TESTS) ;
check.abortrecover: $(RECOVER_TESTS) ;
.PHONY: fastcheck.tdb fastcheckonlyfail.tdb
fastcheck.tdb: $(patsubst %,%.fast,$(RUN_TDB_TESTS))
fastcheckonlyfail.tdb: $(patsubst %,%.fastonlyfail,$(RUN_TDB_TESTS))
foo:
echo RUN_TDB_TESTS: $(RUN_TDB_TESTS)
echo ALL_TESTS: $(ALL_TESTS)
#TODO: What is this for? TODO: Port this if necessary.
#traces: test_env_open_flags.tdbt$(BINSUF)
traces: $(patsubst %.tdb$(BINSUF),%.tdbt$(BINSUF),$(TDB_TESTS))
.PHONY: %.bdbrun %.run %.tdbrun
# STUFF!!!!
%.run: %.bdbrun %.tdbrun
SHOULD_FAIL = $(TDB_TESTS_THAT_SHOULD_FAIL_LIT) $(patsubst %,%.tdbrun,$(TDB_TESTS_THAT_SHOULD_FAIL)) \
$(BDB_TESTS_THAT_SHOULD_FAIL_LIT) $(patsubst %,%.bdbrun,$(BDB_TESTS_THAT_SHOULD_FAIL))
# Any test that should fail, we invert the result by using MAYBEINVERTER
$(SHOULD_FAIL): MAYBEINVERTER=$(INVERTER)
$(SHOULD_FAIL): SUMMARIZE_CMD=$(SUMMARIZE_SHOULD_FAIL)
# I want the failing tests to send their stderr to /dev/null
$(SHOULD_FAIL): VGRIND+= --log-file=/dev/null
# $(SHOULD_FAIL): INVERTER= 2> /dev/null ;test $$? -ne 0
TDBVGRIND=$(VGRIND)
ifeq ($(OS_CHOICE),windows)
ifdef BDBDIR
%.bdb$(BINSUF): INCLUDEDIRS=-I$(BDBDIR)/include -I$(TOKUROOT)ft
%.bdb$(BINSUF): RPATH_DIRS=$(BDBDIR)/lib
endif
ifeq ($(DEBUG),0)
WINDOWS_BDB_LIB_NAME=libdb.$(SOEXT)
$(WINDOWS_BDB_LIB_NAME):
cp $(BDBDIR)/lib/libdb[0-9][0-9].$(SOEXT) ./
else
WINDOWS_BDB_LIB_NAME=libdbd.$(SOEXT)
$(WINDOWS_BDB_LIB_NAME):
cp $(BDBDIR)/lib/libdb[0-9][0-9]d.$(SOEXT) ./
endif
%.bdb$(BINSUF): DLINK_FILES=$(BDBDIR)/lib/$(WINDOWS_BDB_LIB_NAME)
#empty
else
WINDOWS_BDB_LIB_NAME=
#linux
ifdef BDBDIR
%.bdb$(BINSUF): INCLUDEDIRS=-I$(BDBDIR)/include
%.bdb$(BINSUF): RPATH_DIRS=$(BDBDIR)/lib
endif
%.bdb$(BINSUF): DLINK_FILES=db.$(SOEXT)
endif
#empty on purpose
# Use -s on the command line to make things quiet.
# Use -s on the command line to make things quiet.
%.bdbrun: %.bdb$(BINSUF) $(DEPEND_COMPILE) $(DEPEND_LINK) $(WINDOWS_BDB_LIB_NAME)
$(BDBVGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
%.tdbrun: %.tdb$(BINSUF) $(DEPEND_COMPILE) $(DEPEND_LINK) $(LIBTDB) $(PTHREAD_LOCAL)
$(TDBVGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
ifeq ($(OS_CHOICE),windows)
TDBDUMP=$(TOKUROOT)utils/tokudb_dump$(BINSUF)
TDBLOAD=$(TOKUROOT)utils/tokudb_load$(BINSUF)
else
TDBDUMP=$(TOKUROOT)utils/tokudb_dump_static$(BINSUF)
TDBLOAD=$(TOKUROOT)utils/tokudb_load_static$(BINSUF)
endif
TDBRECOVER=$(TOKUROOT)ft/tdb-recover$(BINSUF)
TDBFTDUMP=$(TOKUROOT)ft/ftdump$(BINSUF)
$(TDBFTDUMP) $(TDBLOAD) $(TDBDUMP) $(TDBRECOVER):
cd $(@D) && $(MAKE) $(@F)
%.recover: %.tdb$(BINSUF) $(PTHREAD_LOCAL) $(TDBRECOVER) $(TDBDUMP)
echo doing ./$< &&\
./$< --no-shutdown && \
rm -rf dir.$*.c.tdb.recover && \
mkdir dir.$*.c.tdb.recover && \
cp dir.$*.c.tdb/tokudb.directory dir.$*.c.tdb.recover/ && \
cp dir.$*.c.tdb/tokudb.environment dir.$*.c.tdb.recover/ && \
cp dir.$*.c.tdb/tokudb.rollback dir.$*.c.tdb.recover/ && \
cp dir.$*.c.tdb/*.tokulog* dir.$*.c.tdb.recover/ && \
echo doing recovery &&\
$(VGRIND) $(TDBRECOVER) dir.$*.c.tdb.recover dir.$*.c.tdb.recover && \
echo dump and compare &&\
$(TDBDUMP) -h dir.$*.c.tdb foo.db > dir.$*.c.tdb/foo.dump && \
$(TDBDUMP) -h dir.$*.c.tdb.recover foo.db > dir.$*.c.tdb.recover/foo.dump && \
diff -q dir.$*.c.tdb/foo.dump dir.$*.c.tdb.recover/foo.dump \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
%.recoverwc: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
(cd dir.$*.c.tdb;pwd;cat log*| ../../../ft/tdb_logprint |wc -c)
ABORTCODE=137
%.abortrecover: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
{ ./$< --test ; } ; \
if [ $$? -ne $(ABORTCODE) ] ; then \
echo $* --test did not return $(ABORTCODE); \
test 0 = 1; \
else \
$(VGRIND) ./$< --recover; \
fi \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
.PHONY: %.recover
all.recover: $(patsubst %,test_log%.recover,$(TLRECOVER)) $(PTHREAD_LOCAL) ;
#DISABLE standard tdbrun for recover tests.
$(patsubst %,test_log%.tdbrun,$(TLRECOVER)): ;
.PHONY: %.fast %.fastonlyfail
%.fast: $(DEPEND_COMPILE) $(DEPEND_LINK) $(LIBTDB) $(PTHREAD_LOCAL)
@(perl -e 'alarm ($(FASTCHECKTIMEOUT) * 60) ; exec @ARGV' $(MAKE) VGRIND= SUMMARIZE=0 $*) &>$*.fastlog ; \
if test $$? != 0 ; then \
printf "%-60s FAIL\nexamine %s\n" $* $*.fastlog; \
exit 2 ; \
else \
printf "%-60s PASS\n" $* ; \
$(RM) $*.fastlog ; \
fi
%.fastonlyfail: $(DEPEND_COMPILE) $(DEPEND_LINK) $(LIBTDB) $(PTHREAD_LOCAL)
@(perl -e 'alarm ($(FASTCHECKTIMEOUT) * 60) ; exec @ARGV' $(MAKE) VGRIND= SUMMARIZE=0 $*) &>$*.fastlog ; \
if test $$? != 0 ; then \
printf "%-60s FAIL\nexamine %s\n" $* $*.fastlog; \
exit 2 ; \
else \
$(RM) $*.fastlog ; \
fi
BDB_CFLAGS=
TDB_CFLAGS=
%.bdb$(BINSUF): BDB_CFLAGS= -DENVDIR=\"dir.$<.bdb\" -DUSE_BDB -DIS_TDB=0 -DTOKU_ALLOW_DEPRECATED
%.bdb$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK)
$(CC) $< $(BDB_CFLAGS) $(BIN_FROM_C_FLAGS) -L$(TOKUROOT)lib -Wl,-rpath,$(shell pwd)/$(TOKUROOT)lib -l$(LIBTOKUPORTABILITY) $(LINK_MUST_BE_LAST)
%.tdbt$(BINSUF): DLINK_FILES+=$(TLIBTDB)
%.tdbt$(BINSUF): RPATH_DIRS+=$(dir $(TLIBTDB))
%.tdb$(BINSUF) %.tdbt$(BINSUF): TDB_CFLAGS= -DENVDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1
%.tdb$(BINSUF) %.tdbt$(BINSUF): CPPFLAGS+=-I$(TOKUROOT)include
ifeq ($(PROF),1)
%.tdb$(BINSUF) %.tdbt$(BINSUF): LDFLAGS+=$(LIBPORTABILITY_A)
else
%.tdb$(BINSUF) %.tdbt$(BINSUF): LDFLAGS+=-l$(LIBTOKUPORTABILITY)
endif
loader-stress-test: CPPFLAGS+=-I$(TOKUROOT)include -DENVDIR=\"dir.$<\"
loader-stress-test: LOADLIBES+=-L../lib -ltokudb -Wl,-rpath,..
%.tdb$(BINSUF) %.tdbt$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(TDB_EXTRA_NEEDED)
$(CC) $< $(TDB_CFLAGS) $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
ifeq ($(VGRIND),)
BDB_SUPPRESSIONS =
else
BDB_SUPPRESSIONS = --suppressions=bdb.supressions --gen-suppressions=all
endif
# VERBOSE=true
# Need these rule so that Make knows about all the file names
.PHONY: %.run
$(RUN_ALL_TESTS):
$(ALL_TESTS):
%.run: %.bdbrun %.tdbrun
@ echo ok
INVERTER=;test $$? -ne 0
# Any test that should fail, we invert the result by using MAYBEINVERTER
$(SHOULD_FAIL): MAYBEINVERTER=$(INVERTER)
HERE = src/tests
# Don't include log2 log3 log4 log5 etc since they are covered by all.recover
# Don't run valgrind on the groupcommit performance tests
test_groupcommit_perf.bdbrun test_groupcommit_perf.tdbrun: VGRIND=
# Use helgrind on the group commit count test
# helgrind is too flakey, so I'm removing it from the tests. -Bradley
#test_groupcommit_count_helgrind.tdbrun: test_groupcommit_count_helgrind.tdb
# $(HGRIND) ./$< $(VERBVERBOSE)
# Don't run valgrind on the diskfull test (since it aborts)
diskfull.tdbrun: VGRIND=
stress-gc.tdbrun: VGRIND=
insert-dup-prelock: VGRIND=
test_3645: VGRIND=
test_large_update_broadcast_small_cachetable.tdbrun: VGRIND=
test_update_broadcast_stress.tdbrun: VGRIND=
test_update_stress.tdbrun: VGRIND=
stress-test.tdbrun: VGRIND=
stress-test.bdbrun: VGRIND=
hot-optimize-table-tests.tdbrun: VGRIND=
test4573-logtrim.tdbrun: VGRIND=
test-xa-prepare.tdbrun: VGRIND=
libs:
cd ..;$(MAKE)
loader-cleanup-test.tdb$(BINSUF) diskfull.tdb$(BINSUF): CPPFLAGS+=-DDONT_DEPRECATE_WRITES
test_db_curs4.tdb$(BINSUF): trace.h
test_db_curs4.bdb$(BINSUF): trace.h
# a bunch of little tests designed to run in parallel
test_get_both_range.tdbrun: \
tgbr_256_a.tdbrun tgbr_256_b.tdbrun tgbr_256_c.tdbrun \
tgbr_128_a.tdbrun tgbr_128_b.tdbrun tgbr_128_c.tdbrun \
tgbr_64_a.tdbrun tgbr_64_b.tdbrun tgbr_64_c.tdbrun \
tgbr_32_a.tdbrun tgbr_32_b.tdbrun tgbr_32_c.tdbrun \
tgbr_16_a.tdbrun tgbr_16_b.tdbrun tgbr_16_c.tdbrun \
tgbr_8_a.tdbrun tgbr_8_b.tdbrun tgbr_8_c.tdbrun \
tgbr_4_a.tdbrun tgbr_4_b.tdbrun tgbr_4_c.tdbrun \
tgbr_2_a.tdbrun tgbr_2_b.tdbrun tgbr_2_c.tdbrun \
tgbr_1_a.tdbrun tgbr_1_b.tdbrun tgbr_1_c.tdbrun \
# intentionally blank line
true $(SUMMARIZE_CMD) #State that this has passed.
tgbr_%_a.tdbrun: test_get_both_range.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(VGRIND) ./$< $(VERBVERBOSE) -i $* -a $(MAYBEINVERTER) $(SUMMARIZE_CMD)
tgbr_%_b.tdbrun: test_get_both_range.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(VGRIND) ./$< $(VERBVERBOSE) -i $* -b $(MAYBEINVERTER) $(SUMMARIZE_CMD)
tgbr_%_c.tdbrun: test_get_both_range.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(VGRIND) ./$< $(VERBVERBOSE) -i $* -c $(MAYBEINVERTER) $(SUMMARIZE_CMD)
ifeq ($(OS_CHOICE),windows)
#Windows BDB cannot run 1426. Save output from linux and compare.
dump.bdb.1426: test1426.bdbdump/dump.bdb.1426
cat $< | unix2dos --u2d > $@
else
dump.bdb.1426: test1426.bdb$(BINSUF) test1426.bdbdump/dump.bdb.1426
./$< -q && \
$(BDBDIR)/bin/db_dump -p -h dir.test1426.c.bdb main > $@
diff -q $@ test1426.bdbdump/$@ #Assert output is correct.
endif
# test1426 is run by comparing the BDB output to the TDB output
# we use the -x flag (no transactions or recovery) in the dump program. (-x is not in the BDB version of dump, but it's in ours)
test1426.tdbrun: test1426.tdb$(BINSUF) dump.bdb.1426 $(PTHREAD_LOCAL) $(TDBDUMP)
(./test1426.tdb$(BINSUF) -q && \
$(TDBDUMP) -x -p -h dir.test1426.c.tdb main > dump.tdb.1426 && \
diff -q -I db_pagesize=4096 dump.bdb.1426 dump.tdb.1426 ) \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
# STRESS RUNS is number of iterations, STRESS_SIZE is operations per iteration (must not change between iterations)
# Note the magic with the brackets is there to suppress the printout of "/bin/bash: line 11: 1234 Killed ...."
# See http://stackoverflow.com/questions/714855/bash-suppress-notice-of-forked-command-being-killed
# also we only print the date if VERBOSE is set to non-null
STRESS_RUNS=5
STRESS_SIZE=5001
checkpoint_stress.tdbrun: SHELL=/bin/bash
checkpoint_stress.tdbrun: checkpoint_stress.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(VGRIND) ./$< -C -n $(STRESS_SIZE) $(VERBVERBOSE) && \
($(VGRIND) ./$< -C -i 0 -n $(STRESS_SIZE) $(VERBVERBOSE) && \
for (( i = 1; i < $(STRESS_RUNS); i++ )); do \
$(if $(VERBOSE),date;) \
{ ./$< -c -i $$i -n $(STRESS_SIZE) $(VERBVERBOSE) 2> dir.checkpoint_stress.c.tdb/error.$$i ; } 2>/dev/null ; \
if [ $$? -ne $(ABORTCODE) ] ; then \
exit 1 ; \
fi ; \
if ! grep -q 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.$$i; then break; fi; \
done && \
test `grep -l 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.* |wc -l` = $$(($(STRESS_RUNS)-1)) \
) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
DISKFULL_ABORTCODE=134
diskfull.tdbrun: SHELL=/bin/bash
diskfull.tdbrun: diskfull.tdb$(BINSUF) $(PTHREAD_LOCAL)
NUM_WRITES=$$($(VGRIND) ./$< -q) && \
(for (( i = 0; i < $$NUM_WRITES; i++ )); do \
{ ./$< -C $$i $(VERBVERBOSE) 2>/dev/null; } 2>/dev/null; \
if [ $$? -ne $(DISKFULL_ABORTCODE) ] ; then \
echo "Diskfull (iteration $$i) did not abort" ; \
exit 1; \
fi; \
done; ) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
recover_stress.tdbrun: SHELL=/bin/bash
recover_stress.tdbrun: checkpoint_stress.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(VGRIND) ./$< -C -n $(STRESS_SIZE) -l $(VERBVERBOSE) && \
($(VGRIND) ./$< -C -i 0 -n $(STRESS_SIZE) -l $(VERBVERBOSE) && \
for (( i = 1; i < $(STRESS_RUNS); i++ )); do \
$(if $(VERBOSE),date;) \
{ ./$< -c -i $$i -n $(STRESS_SIZE) -l $(VERBVERBOSE) 2> dir.checkpoint_stress.c.tdb/error.$$i ; } 2>/dev/null ; \
if [ $$? -ne $(ABORTCODE) ] ; then \
exit 1 ; \
fi ; \
if ! grep -q 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.$$i; then break; fi; \
done && \
test `grep -l 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.* |wc -l` = $$(($(STRESS_RUNS)-1)) \
) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
recovery_fileops_unit.tdbrun: SHELL=/bin/bash
recovery_fileops_unit.tdbrun: recovery_fileops_unit.tdb$(BINSUF) $(PTHREAD_LOCAL)
rm -rf dir.$@.errors
mkdir dir.$@.errors
$(MAYBEATSIGN)( \
Oset="c d r"; \
aset="0 1"; \
bset="0 1"; \
cset="0 1 2"; \
fset="0 1"; \
count=0; \
for O in $$Oset; do \
if test $$O = c ; then \
gset="0"; \
hset="0"; \
else \
gset="0 1 2 3 4 5"; \
hset="0 1"; \
fi; \
for a in $$aset; do \
for b in $$bset; do \
if test $$b -eq 0 ; then \
dset="0"; \
eset="0"; \
else \
dset="0 1"; \
eset="0 1"; \
fi; \
for c in $$cset; do \
for d in $$dset; do \
for e in $$eset; do \
for f in $$fset; do \
for g in $$gset; do \
for h in $$hset; do \
if test \( $$O != c \) -a \( $$c -eq 0 \) -a \( \( $$b -eq 0 \) -o \( $$e -eq 0 \) -o \( $$d -eq 1 \) \) ; then \
iset="0 1"; \
else \
iset="0"; \
fi; \
for i in $$iset; do \
errorfile=dir.$@.errors/crash.$$O.$$a.$$b.$$c.$$d.$$e.$$f.$$g.$$h.$$i; \
combination="-O $$O -A $$a -B $$b -C $$c -D $$d -E $$e -F $$f -G $$g -H $$h -I $$i"; \
{ ./$< $(VERBVERBOSE) -c $$combination 2> $$errorfile ; } 2>/dev/null ;\
if [ $$? -ne $(ABORTCODE) ] ; then \
{ cat dir.$@.errors/crash; echo Error: no crash in $$errorfile ; exit 1; }; \
fi ; \
grep 'HAPPY CRASH' $$errorfile >/dev/null || { cat $$errorfile; echo Error: incorrect crash in $$errorfile ; exit 1; }; \
./$< $(VERBVERBOSE) -r $$combination 2>> $$errorfile || { cat $$errorfile ; echo Error: during recovery in $$errorfile ; exit 1; }; \
count=$$(($$count + 1)); \
done; \
done; \
done; \
done; \
done; \
done; \
done; \
done; \
done; \
done; \
(test -n "$(VERBOSE)" && echo $$count tests passed) || true; \
) $(SUMMARIZE_CMD)
# helgrind1 is supposed to fail.
helgrind1.tdbrun: TDBVGRIND=$(HGRIND) --log-file=helgrind1.tdb.deleteme
helgrind1.tdbrun: MAYBEINVERTER=$(INVERTER)
helgrind2.bdbrun: BDBVGRIND=$(HGRIND)
helgrind2.tdbrun helgrind3.tdbrun: TDBVGRIND=$(HGRIND)
helgrind2.tdbrun helgrind3.tdbrun: HGRIND+=--suppressions=helgrind.suppressions
helgrind3.bdbrun: BDBVGRIND=$(HGRIND)
test_groupcommit_count_hgrind.tdbrun: HGRIND+=--suppressions=helgrind.suppressions
test_groupcommit_count_hgrind.tdbrun: test_groupcommit_count.tdb$(BINSUF)
$(HGRIND) ./test_groupcommit_count.tdb$(BINSUF) $(VERBVERBOSE) -n 1 -p hgrind $(SUMMARIZE_CMD)
test_groupcommit_count_drd.tdbrun: DRD+=--suppressions=drd.suppressions
test_groupcommit_count_drd.tdbrun: test_groupcommit_count.tdb$(BINSUF)
$(DRD) ./test_groupcommit_count.tdb$(BINSUF) $(VERBVERBOSE) -n 1 -p drd $(SUMMARIZE_CMD)
test_groupcommit_count_vgrind.tdbrun: test_groupcommit_count.tdb$(BINSUF)
$(VGRIND) ./test_groupcommit_count.tdb$(BINSUF) $(VERBVERBOSE) -n 1 -p vgrind $(SUMMARIZE_CMD)
# we deliberately don't close the env, so recovery runs
# lets avoid all of the valgrind errors
test-recover1.tdbrun: VGRIND=
test-recover2.tdbrun: VGRIND=
test-recover3.tdbrun: VGRIND=
# test-prepare cannot handle valgrind since the environment doesn't close properly.
test-prepare.tdbrun: VGRIND=
test-prepare2.tdbrun: VGRIND=
test-prepare3.tdbrun: VGRIND=
# filesize is too slow with vgrind.
filesize.tdbrun: VGRIND=
powerfail.tdbrun:
@echo must run powerfail by hand $(SUMMARIZE_CMD)
dumpit: $(TDBFTDUMP)
$(TDBFTDUMP) dir.test_log5.c.tdb.recover/foo.db > dump.r && $(TDBFTDUMP) dir.test_log5.c.tdb/foo.db > dump.o && diff -q dump.o dump.r
# test on small stacks
test_thread_stack.%run: test_thread_stack.%$(BINSUF) $(PTHREAD_LOCAL)
./$< -a -thread_stack 16384 && \
./$< -a -thread_stack 16384 -resume $(SUMMARIZE_CMD)
preload-db-nested.tdbrun: VGRIND=
upgrade-test-4.tdbrun: VGRIND=
ROOT_FIFO_41_RUNS = $(foreach num, $(shell seq 1 100), root_fifo_41_$(num)_populate.tdbrun root_fifo_41_$(num)_nopopulate.tdbrun)
root_fifo_41.tdbrun: $(ROOT_FIFO_41_RUNS)
@echo -n
root_fifo_41_%_populate.tdbrun: root_fifo_41.tdb
$(VGRIND) ./$< -n $(patsubst root_fifo_41_%_populate.tdbrun, %, $@) -h $(patsubst %.tdbrun, %.tdbdir, $@) -populate $(SUMMARIZE_CMD)
@rm -rf $(patsubst %.tdbrun, %.dir, $@)
root_fifo_41_%_nopopulate.tdbrun: root_fifo_41.tdb
$(VGRIND) ./$< -n $(patsubst root_fifo_41_%_nopopulate.tdbrun, %, $@) -h $(patsubst %.tdbrun, %.tdbdir, $@) $(SUMMARIZE_CMD)
@rm -rf $(patsubst %.tdbrun, %.dir, $@)
test3039.tdbrun: test3039.tdb
( ($(VGRIND) ./$< -v -n 1000 ) && ./$< -v ) $(SUMMARIZE_CMD)
# loader tests
.PHONY: %.loader
%.loader: %.nop.loader %.p.loader
true
%.nop.loader: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -e dir.$@ $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
%.p.loader: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -p -e dir.$@ $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
# re-enable loader-stress-test3 when upgrade is complete
#loader-stress-test.loader: $(patsubst %,loader-stress-test%.tdbrun, 0 1 2 3 4)
loader-stress-test.loader: $(patsubst %,loader-stress-test%.tdbrun, 0 1 2 4)
true
loader-stress-test0.tdbrun: loader-stress-test.tdb$(BINSUF)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -c -e dir.$@ $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
loader-stress-test1.tdbrun: loader-stress-test.tdb$(BINSUF)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -c -p -e dir.$@ $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
loader-stress-test2.tdbrun: loader-stress-test.tdb$(BINSUF)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -r 5000 -s -e dir.$@ $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD) # to manifest #2717.
loader-stress-test3.tdbrun: loader-stress-test.tdb$(BINSUF)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -u -c -e dir.$@ $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
# run without valgrind
loader-stress-test4.tdbrun: loader-stress-test.tdb$(BINSUF)
./$< -r 10000000 -c -e dir.$@ $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
loader-dup-test.loader loader-dup-test.tdbrun: $(patsubst %,loader-dup-test%.tdbrun, 0 1 2 3 4 5)
true $(SUMMARIZE_CMD) #State that this has passed. Override the default rule.
loader-dup-test0.tdbrun: loader-dup-test.tdb$(BINSUF)
$(VGRIND) ./loader-dup-test.tdb -e dir.$@ $(SUMMARIZE_CMD)
loader-dup-test1.tdbrun: loader-dup-test.tdb$(BINSUF)
$(VGRIND) ./loader-dup-test.tdb -d 1 -r 500000 -e dir.$@ $(SUMMARIZE_CMD)
loader-dup-test2.tdbrun: loader-dup-test.tdb$(BINSUF)
$(VGRIND) ./loader-dup-test.tdb -d 1 -r 1000000 -e dir.$@ $(SUMMARIZE_CMD)
loader-dup-test3.tdbrun: loader-dup-test.tdb$(BINSUF)
$(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 100 -e dir.$@ $(SUMMARIZE_CMD)
loader-dup-test4.tdbrun: loader-dup-test.tdb$(BINSUF)
$(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 1000 -e dir.$@ $(SUMMARIZE_CMD)
loader-dup-test5.tdbrun: loader-dup-test.tdb$(BINSUF)
$(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 1000 -E -e dir.$@ $(SUMMARIZE_CMD)
test_abort4.tdbrun: $(foreach x, 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -1, test_abort4_$x_0.tdbrun test_abort4_$x_1.tdbrun )
true $(SUMMARIZE_CMD)
test_abort4_%_0.tdbrun: test_abort4.tdb
$(VGRIND) ./test_abort4.tdb -q -e dir.$@ -c 0 -l $(patsubst test_abort4_%_0.tdbrun,%,$@) $(SUMMARIZE_CMD)
test_abort4_%_1.tdbrun: test_abort4.tdb
$(VGRIND) ./test_abort4.tdb -q -e dir.$@ -c 1 -l $(patsubst test_abort4_%_1.tdbrun,%,$@) $(SUMMARIZE_CMD)
# as part of #4503, we took out test 1 and 3
# loader-cleanup-test.loader: $(patsubst %,loader-cleanup-test%.tdbrun, 0 1 2 3)
loader-cleanup-test.loader: $(patsubst %,loader-cleanup-test%.tdbrun, 0 2)
true
# this one uses valgrind and uses relatively few rows
loader-cleanup-test0.tdbrun: loader-cleanup-test.tdb$(BINSUF)
$(VGRIND) ./$< -s -r 800 -e dir.$@ $(SUMMARIZE_CMD)
loader-cleanup-test1.tdbrun: loader-cleanup-test.tdb$(BINSUF)
$(VGRIND) ./$< -s -r 800 -p -e dir.$@ $(SUMMARIZE_CMD)
# This one is like test0 except without valgrind
loader-cleanup-test2.tdbrun: loader-cleanup-test.tdb$(BINSUF)
./$< -s -r 8000 -e dir.$@ $(SUMMARIZE_CMD)
loader-cleanup-test3.tdbrun: loader-cleanup-test.tdb$(BINSUF)
./$< -s -r 8000 -p -e dir.$@ $(SUMMARIZE_CMD)
loader-tests: $(LOADER_TESTS)
echo $(LOADER_TESTS)
# hot indexer tests
HOTINDEXER_UNDO_TESTS = $(wildcard hotindexer-undo-do-tests/*.test)
CHECK_HOTINDEXER_UNDO_TESTS = $(patsubst %.test,%.run,$(HOTINDEXER_UNDO_TESTS))
hotindexer-undo-do-test.tdbrun: $(CHECK_HOTINDEXER_UNDO_TESTS)
true
$(CHECK_HOTINDEXER_UNDO_TESTS): %.run: %.test hotindexer-undo-do-test.tdb$(BINSUF)
./run-hotindexer-undo-do-tests.bash $< $(SUMMARIZE_CMD)
# blocking lock tree tests
BLOCKING_SRCS = $(wildcard blocking-*.c db-put-*.c)
BLOCKING_TDB_TESTS = $(patsubst %.c,%.tdbrun,$(BLOCKING_SRCS))
BLOCKING_BDB_TESTS = $(patsubst %.c,%.bdbrun,$(BLOCKING_SRCS))
check_blocking.tdbrun: $(BLOCKING_TDB_TESTS)
check_blocking.bdbrun: $(BLOCKING_BDB_TESTS)
STRESS_TEST_SRCS = $(wildcard test_stress*.c)
STRESS_TESTS = $(patsubst %.c,%,$(STRESS_TEST_SRCS))
stress_tests.tdbrun: $(patsubst %,%.stressrun,$(STRESS_TESTS))
true
%.stressrun: %.tdb
./$< --only_create --envdir dir.$@ && \
$(VGRIND) ./$< $(VERBVERBOSE) --only_stress --num_seconds 1000 --envdir dir.$@ \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
# stress tests with drd
TINY_STRESS_TESTS = $(patsubst %,tiny_%.drdrun,$(STRESS_TESTS))
MID_STRESS_TESTS = $(patsubst %,mid_%.drdrun,$(STRESS_TESTS))
LARGE_STRESS_TESTS = $(patsubst %,large_%.drdrun,$(STRESS_TESTS))
stress_tests.drdrun: $(TINY_STRESS_TESTS) \
$(MID_STRESS_TESTS) \
large_test_stress1.drdrun large_test_stress3.drdrun \
test_4015.drdrun
true
tiny_stress_tests.drdrun: $(TINY_STRESS_TESTS)
true
mid_stress_tests.drdrun: $(MID_STRESS_TESTS)
true
large_stress_tests.drdrun: $(LARGE_STRESS_TESTS)
true
tiny_%.drdrun: %.tdb
$(VALGRIND) --tool=drd --quiet --suppressions=drd.suppressions --error-exitcode=1 ./$< $(VERBVERBOSE) --num_seconds 5 --num_elements 150 --envdir dir.$@ \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
mid_%.drdrun: %.tdb
./$< --only_create --envdir dir.$@ --num_elements 10000 && \
$(VALGRIND) --tool=drd --quiet --suppressions=drd.suppressions --error-exitcode=1 ./$< $(VERBVERBOSE) --only_stress --num_seconds 100 --envdir dir.$@ --num_elements 10000 \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
large_%.drdrun: %.tdb
./$< --only_create --envdir dir.$@ && \
$(VALGRIND) --tool=drd --quiet --suppressions=drd.suppressions --error-exitcode=1 ./$< $(VERBVERBOSE) --only_stress --num_seconds 1000 --envdir dir.$@ \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
test_4015.drdrun: test_4015.tdb
$(VALGRIND) --tool=drd --quiet --suppressions=drd.suppressions --error-exitcode=1 ./$< --envdir dir.tdb.$@ \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
# upgrade tests
UPGRADE_TEST_SRCS = $(wildcard upgrade-test-*.c)
UPGRADE_TESTS = $(patsubst %.c,%,$(UPGRADE_TEST_SRCS))
UPGRADE_TESTS_VALGRIND = $(patsubst upgrade-test-%,upgrade-test-%.valgrind,$(UPGRADE_TESTS))
upgrade-tests.tdbrun: $(UPGRADE_TESTS_VALGRIND)
echo $(UPGRADE_TESTS_VALGRIND)
true
upgrade-test-%.valgrind: upgrade-test-%.tdb
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
# keyrange tests
keyrange.tdbrun: keyrange-get0.tdbrun keyrange-get1.tdbrun \
keyrange-random-get0.tdbrun keyrange-random-get1.tdbrun \
keyrange-loader-get0.tdbrun keyrange-loader-get1.tdbrun
true
keyrange-get0.tdbrun: keyrange.tdb
$(TDBVGRIND) ./$< $(VERBVERBOSE) --get 0 --envdir dir.$@ $(MAYBEINVERTER) $(SUMMARIZE_CMD)
keyrange-get1.tdbrun: keyrange.tdb
$(TDBVGRIND) ./$< $(VERBVERBOSE) --get 1 --envdir dir.$@ $(MAYBEINVERTER) $(SUMMARIZE_CMD)
keyrange-random-get0.tdbrun: keyrange.tdb
$(TDBVGRIND) ./$< $(VERBVERBOSE) --get 0 --random_keys 1 --envdir dir.$@ $(MAYBEINVERTER) $(SUMMARIZE_CMD)
keyrange-random-get1.tdbrun: keyrange.tdb
$(TDBVGRIND) ./$< $(VERBVERBOSE) --get 1 --random_keys 1 --envdir dir.$@ $(MAYBEINVERTER) $(SUMMARIZE_CMD)
keyrange-loader-get0.tdbrun: keyrange.tdb
$(TDBVGRIND) ./$< $(VERBVERBOSE) --get 0 --loader 1 --envdir dir.$@ $(MAYBEINVERTER) $(SUMMARIZE_CMD)
keyrange-loader-get1.tdbrun: keyrange.tdb
$(TDBVGRIND) ./$< $(VERBVERBOSE) --get 1 --loader 1 --envdir dir.$@ $(MAYBEINVERTER) $(SUMMARIZE_CMD)
maxsize-for-loader.tdbrun: maxsize-for-loader-A.tdbrun maxsize-for-loader-B.tdbrun
@echo -n
maxsize-for-loader-A.tdbrun: maxsize-for-loader.tdb
$(TDBVGRIND) ./$< -e $@ -f 2> /dev/null $(SUMMARIZE_CMD)
maxsize-for-loader-B.tdbrun: maxsize-for-loader.tdb
./$< -e $@ 2> /dev/null $(SUMMARIZE_CMD)
# dont run perf tests with valgrind
perf_%.tdbrun: VGRIND=
clean:
rm -f $(ALL_BINS)
rm -rf dir.* *.check.output *.check.valgrind
rm -f dump.bdb.1426 dump.tdb.1426 test1426.bdb
rm -f *.bdb *.tdb
rm -f *.fastlog
rm -rf rundir.* recover-test_stress*.dir
# Tests which fail whenever I muck with recovery or XA -Bradley
rtests: \
recover-upgrade-db-descriptor.abortrecover \
recovery_fileops_unit.tdbrun \
recover-tablelock.abortrecover \
hotindexer-insert-committed-optimized.tdbrun \
test-prepare.tdbrun \
test-prepare2.tdbrun \
test-prepare3.tdbrun \
#Blank
# -*- Mode: Makefile -*-
# TODO: Find a way to point out directories (i.e. current dir, or root dir)
# TODO: Find the names of the icc windows library includes.. i.e. dlls/etc.
# TODO: Find icc equivalents for W64 (warn about 32 vs 64 bit incompatibility
# TODO: Add (linux) icc warning about windows porting issues.
# TODO: There is an icc option for short 1-liner diagnostics.. see if there is
# an opposite! (i.e. long diagnostics which maybe will give us a stack trace
# for warnings)
# TODO: Learn how the hell to use idb.
#
# Default include makefile.
# Before (or after?) including this makefile, define the following variables
# INCLUDES = -I $(TOKUROOT)/.. -I . -I $(TOKUROOT)/... #Whatever include directories
# List of directories to include for search paths.
# TOKUROOT = absolute path of the root of this branch.
# TODO: find alternative way to do this.
# BINS = base names for bins
# SUBDIRS = Subdirs to make/clean
#
# On cygwin do:
# make CYGWIN=cygwin check
#
# For default=debug (no optimization) do
# make DEBUG=1
# For verbose output do
# make VERBOSE=1
# For very verbose output do
# make VERBOSE=2
# For CIL do
# make CIL=1
# For coverage do
# make GCOV=1
# For profiling do
# make PROF=1
# To make warnings be warnngs instead of errors do
# make WERROR=
ifeq ($(DEBUG),)
DEBUG = 0
endif
ifeq ($(HAVE_CILK),)
HAVE_CILK = 0
endif
ifeq ($(VTUNE),1)
LINK_MUST_BE_LAST = /link /fixed:no
else
LINK_MUST_BE_LAST =
endif
.DELETE_ON_ERROR:
ifneq ($(GCOV),)
GCOV_FLAGS = -fprofile-arcs -ftest-coverage -DGCOV
endif
ifneq ($(PROF),)
PROF_FLAGS = -pg
endif
ifeq ($(FASTCHECKTIMEOUT),)
FASTCHECKTIMEOUT = 30
endif
OPT_OPTFLAGS = -O3 -finline-functions
DBG_OPTFLAGS = -O0
SYSTEM = $(shell uname -s | tr [:upper:] [:lower:])
ARCH = $(shell uname -m | tr [:upper:] [:lower:])
ifeq ($(VERBOSE),2)
VERBVERBOSE=-v
MAYBEATSIGN=
else ifeq ($(VERBOSE),1)
VERBVERBOSE=
MAYBEATSIGN=
else
VERBVERBOSE=-q
MAYBEATSIGN=@
endif
CPPFLAGS = $(INCLUDEDIRS) -I$(PORTABILITY_HEADERS) -I$(TOKUROOT)toku_include $(EXTRA_INCLUDES)
ifeq ($(SYSTEM),freebsd)
CPPFLAGS += -DTOKU_ALLOW_DEPRECATED
endif
ifeq ($(SYSTEM),sunos)
CPPFLAGS += -DTOKU_ALLOW_DEPRECATED
endif
ifeq ($(CC),icc)
CPPFLAGS += -DUSING_ICC
ifeq ($(HAVE_CILK),1)
CPPFLAGS += -DHAVE_CILK
LCILKRTS += -lcilkrts
endif
endif
ifeq ($(TOKUDB_REVISION),)
TOKUDB_REVISION = 0
endif
CPPFLAGS += -DTOKUDB_REVISION=$(TOKUDB_REVISION)
#CFLAG default options
# Add -Wconversion #DISABLED for now.
ifeq ($(SYSTEM),freebsd)
WERROR =
else
WERROR = -Werror
endif
ifeq ($(GCCVERSION),)
GCCVERSION = $(shell $(CC) --version | head -1 | cut -f3 -d " ")
endif
# -Wno-deprecated is needed on gcc 4.4.{0,1,2,4} to make the #ident complaints go away.
# -Wno-strict-aliasing is needed on gcc 4.4.{1,2,4} to make certain gratuitous warnings go away.
# -Wno-unused-result is needed on gcc 4.4.1 to make warnings about ignoring the results of certain system calls go away.
# Gcc 4.4.1-4ubuntu9 cannot handle --combine, but 4.4.4 can. But 4.5 cannot.
ifeq ($(GCCVERSION),4.6.1)
GCC_VERSION_SPECIFIC = -Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-but-set-parameter
else ifeq ($(GCCVERSION),4.6.0)
GCC_VERSION_SPECIFIC = -Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-but-set-parameter
else ifeq ($(GCCVERSION),4.4.4)
GCC_VERSION_SPECIFIC = -Wno-deprecated
else ifeq ($(GCCVERSION),4.4.2)
GCC_VERSION_SPECIFIC = -Wno-deprecated
else ifeq ($(GCCVERSION),4.4.1)
GCC_VERSION_SPECIFIC = -Wno-deprecated -Wno-unused-result
COMBINE := 0
else ifeq ($(GCCVERSION),4.4.0)
GCC_VERSION_SPECIFIC = -Wno-deprecated
else ifeq ($(GCCVERSION),4.6.2)
COMBINE := 0
else ifeq ($(GCCVERSION),4.6.3)
COMBINE := 0
endif
WALL = $(GCC_VERSION_SPECIFIC) -Wall -Wextra -Wcast-align -Wbad-function-cast -Wno-missing-noreturn -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
-Wpointer-arith # don't do arithmetic on void*.
FORMAT = -Wmissing-format-attribute #-Wformat=2 #Stronger printf warnings once logger.c cleaned up
ifeq ($(SYSTEM),sunos)
VISIBILITY=
else
VISIBILITY= -fvisibility=hidden
endif
FPICFLAGS = -fPIC
SHADOW = -Wshadow
SYMBOLS = -g3 -ggdb3
PORTABILITY=
SKIP_WARNING=
COMBINE_C = -combine -c
ifeq ($(GCCVERSION),4.4.4)
CFLAGS += -Wno-strict-aliasing
else ifeq ($(GCCVERSION),4.4.2)
CFLAGS += -Wno-strict-aliasing
else ifeq ($(GCCVERSION),4.4.1)
CFLAGS += -Wno-strict-aliasing
else ifeq ($(GCCVERSION),4.4.0)
CFLAGS += -Wno-strict-aliasing
else ifeq ($(GCCVERSION),4.6.2)
CFLAGS += -Wno-error=deprecated-declarations
# Valgrind 3.6.1 annotations have unused but set variables. Valgrind 3.7.0 fixed this problem.
CFLAGS += -Wno-unused-but-set-variable
else ifeq ($(GCCVERSION),4.6.3)
# Valgrind 3.6.1 annotations have unused but set variables. Valgrind 3.7.0 fixed this problem.
CFLAGS += -Wno-unused-but-set-variable
endif
LIBTOKUDB=tokudb
LIBTOKUPORTABILITY=tokuportability
LIBPORTABILITY_SO=$(TOKUROOT)lib/lib$(LIBTOKUPORTABILITY).$(SOEXT)
LIBPORTABILITY_A=$(TOKUROOT)lib/lib$(LIBTOKUPORTABILITY).$(AEXT)
PORTABILITY_HEADERS= $(TOKUROOT)$(SYSTEM)
ALWAYS_LINK= -lz -lpthread -ldl
ifeq ($(CC),icc)
# needed for things like intel_fast_memset(), intel_sse2_strlen()
ifeq ($(DEBUG),0)
IRCSTATIC = -Bstatic
else
IRCSTATIC =
endif
ALWAYS_LINK+=$(IRCSTATIC) -lirc -Bdynamic -lstdc++
endif
C99 = -std=c99
W64 = #-Wshorten-64-to-32
BINOUTPUT = -o
OOUTPUT = -o
AROUTPUT =#empty
BINSUF=#none
WRONGBINSUF=.exe
OEXT=o
WRONGOEXT=obj
AEXT=a
WRONGAEXT=lib
SOEXT=so
WRONGSOEXT=dll
AR=ar
DBG_ARFLAGS=cr
OPT_ARFLAGS=cr
LINK=-l
DEPEND_COMPILE += \
$(TOKUROOT)include/db.h \
$(TOKUROOT)toku_include/toku_os.h \
$(TOKUROOT)toku_include/toku_portability.h \
$(TOKUROOT)toku_include/rdtsc.h \
# keep this line so I can have a \ on the previous line
CCQUIET=
comma:=,
empty:=#
space:=$(empty) $(empty)
LINK_LPATH=$(patsubst %,-Wl$(comma)-rpath$(comma)%,$(RPATH_DIRS))
LINK_RPATH=$(patsubst %,-L%$(space),$(RPATH_DIRS))
DLINK_FILES_PREPROCESS_1=$(patsubst %.$(SOEXT),%,$(DLINK_FILES))
DLINK_FILES_PREPROCESS_2=$(patsubst lib%,%,$(notdir $(DLINK_FILES_PREPROCESS_1)))
LINK_DLINK_FILES=$(patsubst %,$(LINK)%,$(notdir $(DLINK_FILES_PREPROCESS_2)))
CRUNTIME=
DEPEND_LINK += \
$(LIBPORTABILITY_SO) \
$(LIBPORTABILITY_A) \
$(LINK_FILES) \
# keep this line so I can have a \ on the previous line
ifeq ($(CYGWIN),)
OS_CHOICE=$(SYSTEM)
OS_NOTCHOICE=windows
else ifneq ($(CC),icc)
OS_CHOICE=$(SYSTEM)
OS_NOTCHOICE=windows
else
OS_CHOICE=windows
OS_NOTCHOICE=$(SYSTEM)
endif
DEPEND_COMPILE += $(wildcard $(TOKUROOT)$(OS_CHOICE)/*.h)
SUPPRESSIONS=no
#Tools
ifeq ($(VALGRIND),)
VALGRIND=valgrind
endif
VGRIND_BASE=$(VALGRIND) --quiet --error-exitcode=1 \
--suppressions=$(TOKUROOT)ft/valgrind.suppressions \
--suppressions=$(TOKUROOT)src/tests/bdb.suppressions \
--gen-suppressions=$(SUPPRESSIONS) --num-callers=20
ifeq ($(DB_ATTACH),1)
VGRIND_BASE+=--db-attach=yes
endif
ifeq ($(TRACK_ORIGINS),1)
VGRIND_BASE+=--track-origins=yes
endif
VGRIND=$(VGRIND_BASE) --leak-check=full --show-reachable=yes
ifeq ($(VGRIND),)
VGRIND_NOMEM=
else
VGRIND_NOMEM=$(VGRIND_BASE)
endif
HGRIND=$(VALGRIND) --quiet --tool=helgrind --error-exitcode=1
DRD=$(VALGRIND) --quiet --tool=drd --error-exitcode=1
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
ifeq ($(WINDBG),)
WINDBG=0
endif
ifeq ($(CC),icc)
#icc only:
OPT_OPTFLAGS = -O3 -ip -ipo1
DBG_OPTFLAGS = -O0
COMBINE_C = -ipo-c
FORMAT= #No argument for extra format warnings.
WALL = -Wall -Wcheck # '-Wextra' becomes '-Wcheck' in icc
SYMBOLS= -g -debug all # deprecated -inline-debug-info
PORTABILITY=-diag-enable port-win
AR=xiar
DISABLE_WARNING=
ifneq ($(CYGWIN),)
#Cygwin
ICC_NOWARN=-Qdiag-disable:
DISABLE_WARNING +=869# Don't complain about unused variables (since we defined __attribute__ to be nothing.)
DISABLE_WARNING +=593# Don't complain about unused variables (since we defined __attribute__ to be nothing.)
DISABLE_WARNING +=11000# Disable message about multi-file optimization
DISABLE_WARNING +=11000# Disable message about single-file optimization
DISABLE_WARNING +=11005# Disable message about creating object file
DISABLE_WARNING +=188# Disable message about 0 used for enum
DISABLE_WARNING +=1011# Disable message about missing return with an abort
else
#Linux
ICC_NOWARN=-diag-disable #Need the space
endif
#DISABLE_WARNING +=111# Unreachable code (i.e. assert(0) )
#DISABLE_WARNING +=271# Remove warnings about trailing comma being nonstandard
#DISABLE_WARNING +=424# Remove warnings about extra ';' being ignored
#DISABLE_WARNING +=810# Remove warnings about losing precision
DISABLE_WARNING +=94# Allow arrays of length 0
#DISABLE_WARNING +=118# Allow void functions to return void functions
#DISABLE_WARNING +=177# Do not complain about static variables that are not used.
#DISABLE_WARNING +=188# Do not complain about enumerated type mixed with another type.
DISABLE_WARNING +=589# Do not complain about goto into a block that skips initializing variables. GCC catches the actual uninitialized variables.
#DISABLE_WARNING +=981# Do not complain about "operands are evaluated in unspecified order". This seems to be generated whenever more than one argument to a function or operand is computed by function call.
#DISABLE_WARNING +=1324# Do not complain about rdtsc clobbering its registers more than once.
#DISABLE_WARNING +=1786# Do not complain about 'read/write/other standards' being deprecated
DISABLE_WARNING +=2259# Do not complain about 'non-pointer conversion from int to u_int8_t (and other small types) may lose significant bits'. This is a useless warning because it produces too many false positives.
DISABLE_WARNING +=11000 11001 11006# Do not remark about multi-file optimizations, single-file optimizations, and object temp files.
DISABLE_WARNING += 11003# Don't complain if some file was not compiled with -ipo
SKIP_WARNING = $(ICC_NOWARN)$(shell sed 's/ /,/g' <<< "$(DISABLE_WARNING)" | sed 's/,//')
endif
ifneq ($(CC),icc)
ifeq ($(ARCH),i686)
ARCHFLAGS = -march=$(ARCH)
endif
endif
ifneq ($(CYGWIN),)
#Cygwin (Windows) Must override some settings
BINSUF=.exe
WRONGBINSUF=#empty
ALWAYS_LINK=/usr/lib/libz.a
SRCPATH_DIRS = `find $(TOKUROOT) -type d | grep -v '/\.[^.]' | grep -F -v "$(TOKUROOT)$(OS_NOTCHOICE)" | tr '\n' ';'`
ifeq ($(WINDBG),1)
VGRIND = windbg -hd -y "$(SRCPATH_DIRS)" -srcpath "$(SRCPATH_DIRS)" #No Valgrind in cygwin #-G is quit at exit, but does not return ERROR on error!!! and quits on error to quickly
else
VGRIND =
endif
HGRIND =#No Hgrind in cygwin
FPICFLAGS=#FPIC is default and not allowed as an option.
VISIBILITY=#Not supported
ifeq ($(CC),icc)
#Cygwin icc only
ifeq ($(CRUNTIME),)
ifeq ($(DEBUG),0)
CRUNTIME=MT
else
CRUNTIME=MTd
endif
endif
ALWAYS_LINK=$(TOKUROOT)windows/lib/$(CRUNTIME)/zlib.lib Ws2_32.lib psapi.lib PowrProf.lib
LINK=#Empty
BINOUTPUT=-Fe
OOUTPUT=-Fo
AROUTPUT=/out:
OEXT=obj
WRONGOEXT=o
AEXT=lib
WRONGAEXT=a
SOEXT=dll
WRONGSOEXT=so
C99 = -Qstd=c99 -Qvc9
OPT_OPTFLAGS = -Ox -Qip -Qipo1
DBG_OPTFLAGS = -Od
COMBINE_C = -Qipo-c
WERROR = -WX # Windows icc version of -Werror
WERROR += -Qdiag-error:167,266,810,592,147 # Workarounds for -WX not being complete on windows icc
SYMBOLS= -Zi -debug:all -Qinline-debug-info
PORTABILITY=
PORTABILITY_HEADERS = $(TOKUROOT)windows
AR=xilib
DBG_AROPT=-qnoipo
OPT_AROPT=-qipo
DBG_ARFLAGS=$(DBG_AROPT) -lib /VERBOSE /WX /NOLOGO
OPT_ARFLAGS=$(OPT_AROPT) -lib /VERBOSE /WX /NOLOGO
CCQUIET=-nologo
LINK_DLINK_FILES=$(patsubst %.$(SOEXT),%.$(AEXT),$(DLINK_FILES))
LINK_RPATH=
LINK_LPATH=
DEPEND_LINK += $(LINK_DLINK_FILES)
W64 = -Wport #-Wp64
else
#Cygwin gcc only
FORMAT = -Wno-format
endif
endif
ifeq ($(DEBUG),0)
OPTFLAGS = $(OPT_OPTFLAGS)
ARFLAGS = $(OPT_ARFLAGS)
else
OPTFLAGS = $(DBG_OPTFLAGS)
ARFLAGS = $(DBG_ARFLAGS)
endif
LZMA_H = $(TOKUROOT)include/lzma.h
ifeq ($(CC),icc)
ifeq ($(DEBUG),1)
LZMA_A = $(TOKUROOT)lib/liblzma_icc_dbg.$(AEXT)
else
LZMA_A = $(TOKUROOT)lib/liblzma_icc_opt.$(AEXT)
endif
else
ifeq ($(DEBUG),1)
LZMA_A = $(TOKUROOT)lib/liblzma_gcc_dbg.$(AEXT)
else
LZMA_A = $(TOKUROOT)lib/liblzma_gcc_opt.$(AEXT)
endif
endif
CFLAGS += $(WALL) $(W64) $(WERROR) $(FORMAT) $(VISIBILITY) $(FPICFLAGS) $(SHADOW) $(ARCHFLAGS)
CFLAGS += $(OPTFLAGS) $(GCOV_FLAGS) $(PROF_FLAGS)
CFLAGS += $(SYMBOLS) $(SKIP_WARNING) $(C99) $(CCQUIET)
LDFLAGS_NOLIB = $(OPTFLAGS) $(SYMBOLS) $(GCOV_FLAGS) $(PROF_FLAGS)
LDFLAGS = $(LDFLAGS_NOLIB) $(LINK_LPATH) $(LINK_FILES) $(ALWAYS_LINK) $(LINK_DLINK_FILES) $(LINK_RPATH)
ifneq ($(CRUNTIME),)
LDFLAGS += -$(CRUNTIME)
CFLAGS += -$(CRUNTIME)
endif
# Need XOPEN_SOURCE=600 to get strtoll()
ifeq ($(SYSTEM),linux)
CPPFLAGS+=-D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
endif
ifeq ($(SYSTEM),sunos)
CPPFLAGS+=-D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
endif
#TODO: Fix this up if we want to keep using CIL.
#ifeq ($(CIL),1)
# CC=../../cil/cil-1.3.6/bin/cilly --merge --keepmerged
#endif
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
ifneq ($(CYGWIN),)
CSCOPE=mlcscope
else
CSCOPE=cscope
endif
.PHONY: tags
tags: $(TOKUROOT)cscope.out $(TOKUROOT)TAGS
ifneq ($(TOKUROOT),./)
TAGS: $(TOKUROOT)*/*.[ch] $(TOKUROOT)*/*/*.[ch] $(TOKUROOT)*/*/*/*.[ch]
etags $(TOKUROOT)*/*.[ch] $(TOKUROOT)*/*/*.[ch] $(TOKUROOT)*/*/*/*.[ch]
endif
$(TOKUROOT)TAGS: $(TOKUROOT)*/*.[ch] $(TOKUROOT)*/*/*.[ch] $(TOKUROOT)*/*/*/*.[ch]
cd $(TOKUROOT) && etags */*.[ch] */*/*.[ch] */*/*/*.[ch]
$(TOKUROOT)cscope.files: $(TOKUROOT)*/*.[ch] $(TOKUROOT)*/*/*.[ch] $(TOKUROOT)*/*/*/*.[ch]
cd $(TOKUROOT) && (echo */*.[ch] */*/*.[ch] */*/*/*.[ch] | tr " " "\n") > $(notdir $@)
$(TOKUROOT)cscope.in.out $(TOKUROOT)cscope.po.out: $(TOKUROOT)cscope.out;
$(TOKUROOT)cscope.out: $(TOKUROOT)cscope.files $(TOKUROOT)*/*.[ch] $(TOKUROOT)*/*/*.[ch] $(TOKUROOT)*/*/*/*.[ch]
cd $(TOKUROOT) && $(CSCOPE) -qb
.PHONY: clean clean-default %.dir.clean
clean: clean-default
%.dir.clean:
cd $* && $(MAKE) clean
clean-default:
rm -f $(BINS) *.$(AEXT) *.$(SOEXT) *.$(OEXT)
rm -f *.bb *.bbg *.da *.gcov *.gcno *.gcda
rm -f *.exe *.obj *.pdb *.ilk
rm -f *.exe.manifest *.dll.manifest
rm -rf *.bundle
#Prevent using the wrong extensions/target types (Otherwise prereqs get confused).
%$(WRONGBINSUF): %.c
echo "Wrong target type: $@ should be $*$(BINSUF)" && false
%$(WRONGBINSUF): %.$(WRONGOEXT)
echo "Wrong target type: $@ should be $*$(BINSUF)" && false
%.$(WRONGOEXT): %.c
echo "Wrong target type: $@ should be $*.$(OEXT)" && false
%.$(WRONGAEXT):
echo "Wrong target type: $@ should be $*.$(AEXT)" && false
%.$(WRONGSOEXT):
echo "Wrong target type: $@ should be $*.$(SOEXT)" && false
ifeq ($(SKIP_LOCKTREERULE),)
LOCKTREE = $(TOKUROOT)src/lock_tree/locktree.$(AEXT)
LOCKTREE_BUNDLE = $(TOKUROOT)src/lock_tree/locktree.bundle
LOCKTREE_LINEAR = $(TOKUROOT)src/lock_tree/locktree_linear.$(AEXT)
LOCKTREE_TLOG = $(TOKUROOT)src/lock_tree/locktree_tlog.$(AEXT)
LOCKTREE_LOG = $(TOKUROOT)src/lock_tree/locktree_log.$(AEXT)
$(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F)
$(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(LIBPORTABILITY_SO)
endif
ifeq ($(SKIP_RANGETREERULE),)
RANGETREE = $(TOKUROOT)src/range_tree/rangetree.$(AEXT)
RANGETREE_BUNDLE = $(TOKUROOT)src/range_tree/rangetree.bundle
RANGETREE_LINEAR = $(TOKUROOT)src/range_tree/rangetree_linear.$(AEXT)
RANGETREE_TLOG = $(TOKUROOT)src/range_tree/rangetree_tlog.$(AEXT)
RANGETREE_LOG = $(TOKUROOT)src/range_tree/rangetree_log.$(AEXT)
$(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F)
$(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(LIBPORTABILITY_SO)
endif
ifeq ($(SKIP_FTRULE),)
LOG_HEADER = $(TOKUROOT)ft/log_header.h
$(LOG_HEADER): $(TOKUROOT)ft/logformat.c
cd $(@D) && $(MAKE) $(@F)
endif
ifeq ($(SKIP_YDBRULE),)
IPO_YDB = $(TOKUROOT)src/ipo_libtokudb.$(AEXT)
NOIPO_YDB = $(TOKUROOT)src/static_libtokudb.$(AEXT)
$(NOIPO_YDB) $(IPO_YDB): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F)
ifeq ($(DEBUG),0)
WIN_YDB = $(IPO_YDB)
else
WIN_YDB = $(NOIPO_YDB)
endif
endif
ifeq ($(OS_CHOICE),windows)
PTHREAD_LIB=$(TOKUROOT)lib/pthreadVC2.dll
PTHREAD_LOCAL=$(notdir $(PTHREAD_LIB))
$(PTHREAD_LOCAL): $(PTHREAD_LIB)
cp -u $< $@
else
PTHREAD_LOCAL=
endif
BIN_FROM_C_FLAGS =$(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) $(BINOUTPUT)$@
BIN_FROM_C_FLAGS_NOLIB=$(CFLAGS) $(CPPFLAGS) $(LDFLAGS_NOLIB) $(BINOUTPUT)$@
%$(BINSUF):%.c $(DEPEND_COMPILE) $(DEPEND_LINK)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
BIN_FROM_O_FLAGS =$(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) $(BINOUTPUT)$@
BIN_FROM_O_FLAGS_NOLIB=$(CFLAGS) $(CPPFLAGS) $(LDFLAGS_NOLIB) $(BINOUTPUT)$@
%$(BINSUF):%.$(OEXT) $(DEPEND_COMPILE) $(DEPEND_LINK)
$(CC) $< $(BIN_FROM_O_FLAGS) $(LINK_MUST_BE_LAST)
%.$(OEXT):%.c $(DEPEND_COMPILE)
$(CC) $< -c $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
CXXFLAGS=$(filter-out -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -std=c99,$(CFLAGS)) $(CPPFLAGS)
%.$(AEXT):
$(AR) $(ARFLAGS) $(AROUTPUT)$@ $(filter %.$(OEXT),$^) $(patsubst %.bundle, %.bundle/*.$(OEXT), $(filter-out %.$(OEXT),$^))
ifeq ($(AEXT),a)
%.bundle: %.$(AEXT)
rm -f $@/*.$(OEXT) && mkdir -p $@ && cd $@ && $(AR) x ../$(<F)
touch $@
else
#Windows lib cannot extract everything.
#Do a for loop and extract one at a time.
%.bundle: %.$(AEXT)
mkdir -p $@ && cd $@ && for ofile in `lib /list ../$(<F) |dos2unix |grep -F obj`; do lib /extract:$$ofile ../$(<F); done
touch $@
endif
ifeq ($(SOEXT),so)
EXPORTMAPFILE=export.map
EXPORTMAP = -Wl,--version-script=$(EXPORTMAPFILE)
SHARED=-shared
ifeq ($(CC),icc)
SHARED += -static-intel -nodefaultlibs
endif
endif
ifeq ($(SOEXT),dll)
ifeq ($(DEBUG),0)
SHARED=/LD
else
SHARED=/LDd
endif
EXPORTMAPFILE=export.def
EXPORTMAP=/link /def:$(EXPORTMAPFILE)
endif
SO_FLAGS=$(SHARED) $(BIN_FROM_O_FLAGS) $(EXPORTMAP)
TOKULINKER = $(CC)
%.$(SOEXT): $(EXPORTMAPFILE)
$(TOKULINKER) $(SO_FLAGS)
#Testing tools
ifeq ($(SUMMARIZE),1)
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
SUMMARIZE_SHOULD_FAIL= ;if test $$? = 0; then printf "%-60sXFAIL\n" $(HERE)/$@; else printf "%-60sXPASS\n" $(HERE)/$@ ; test 0 = 1; fi
INVERTER=;test $$? -ne 0
else
SUMMARIZE_CMD =
endif
#target for flymake-mode
.PHONY: check-syntax
check-syntax: $(DEPEND_COMPILE)
$(CC) $(CPPFLAGS) $(CFLAGS) -fno-ident -fsyntax-only $(CHK_SOURCES)
#Auto change variables from raw to include .exe if necessary.
BINS = $(patsubst %,%$(BINSUF),$(BINS_RAW))
OBJS = $(patsubst %,%.$(OEXT),$(OBJS_RAW))
REGRESSION_TESTS = $(patsubst %,%$(BINSUF),$(REGRESSION_TESTS_RAW))
APPVERIFIER_TESTS=exceptions handles heaps locks memory threadpool tls dangerousapis dirtystacks filepaths inputoutput
APPVERIFIER_TESTS_NONDEFAULT=heaps.backward:TRUE heaps.protect:TRUE
ENABLE_APPVERIFIER_FOR=appverif -enable $(APPVERIFIER_TESTS) -with $(APPVERIFIER_TESTS_NONDEFAULT) -for
DISABLE_APPVERIFIER_FOR=appverif -disable \* -for
%.appverifyenable:
$(ENABLE_APPVERIFIER_FOR) $*.exe
%.appverifydisable:
$(DISABLE_APPVERIFIER_FOR) $*.exe
.PHONY:%.appverifyenable %.appverifydisable %.appverifymaybeenable %.appverifymaybedisable
EXE_FILES = $(wildcard *.exe)
appverifyenable: $(patsubst %.exe,%.appverifyenable,$(EXE_FILES));
appverifydisable: $(patsubst %.exe,%.appverifydisable,$(EXE_FILES));
# -*- Mode: Makefile -*-
# standard build: make
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
.DEFAULT_GOAL= build
TOKUROOT=../
INCLUDEDIRS=-I. -I$(TOKUROOT)toku_include -I$(TOKUROOT)include -I$(TOKUROOT)ft -I$(TOKUROOT)src
DEPEND_COMPILE += \
./*.h \
#end
HERE = utils
include $(TOKUROOT)toku_include/Makefile.include
ifndef BDBDIR
BDBDIR=/usr/local/BerkeleyDB.4.6
endif
BDB_DUMP= LD_LIBRARY_PATH=$(BDBDIR)/lib $(BDBDIR)/bin/db_dump$(BINSUF) -h dir.$@.bdb
BDB_LOAD= LD_LIBRARY_PATH=$(BDBDIR)/lib $(BDBDIR)/bin/db_load$(BINSUF) -h dir.$@.bdb
DIFF=diff -q -I 'db_pagesize='
# vars to compile bins that handle tokudb using libdb.so
# when one uses relative address in an rpath, the library better be located relative
# to the current directory
# vars to compile bins that handle tokudb using libtokudb.a
CPPFLAGS+= -D_GNU_SOURCE
# vars to compile bins that handle bdb
BDB_CPPFLAGS = -I$(BDBDIR)/include
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -lpthread $(BDB_LOADLIBES)
UTILS= \
tokudb_gen$(BINSUF) \
tokudb_load$(BINSUF) \
tokudb_dump$(BINSUF) \
#End
BDB_UTILS=$(patsubst %$(BINSUF),%.bdb$(BINSUF),$(UTILS))
STATIC_UTILS=$(patsubst %$(BINSUF),%_static$(BINSUF),$(UTILS))
ifeq ($(OS_CHOICE),windows)
$(UTILS): LINK_FILES+=$(WIN_YDB)
$(UTILS): $(WIN_YDB)
else
YDB_OBJS=$(wildcard ../src/*.$(OEXT))
ifeq ($(PROF),1)
$(STATIC_UTILS) $(UTILS): LINK_FILES=$(YDB_OBJS) $(TOKUROOT)lib/libtokudb.$(AEXT) $(LOCKTREE) $(RANGETREE) $(TOKUROOT)lib/libft.$(AEXT) $(LIBPORTABILITY_A)
else
$(UTILS): DLINK_FILES=$(TOKUROOT)lib/libtokudb.$(SOEXT) $(TOKUROOT)lib/libtokuportability.$(SOEXT)
$(STATIC_UTILS): LINK_FILES+= $(YDB_OBJS) ../src/lock_tree/locktree.a ../src/range_tree/rangetree.a ../lib/libft.a ../lib/libtokuportability.a $(LZMA_A)
endif
ifeq ($(FTLOADER),cilk)
DLINK_FILES += cilkrts stdc++
RPATH_DIRS += $(CILKROOT)lib64
endif
$(UTILS) $(STATIC_UTILS): RPATH_DIRS+=$(TOKUROOT)lib
endif
#empty
ifeq ($(OS_CHOICE),windows)
ifdef BDBDIR
$(BDB_UTILS): INCLUDEDIRS=-I$(BDBDIR)/include
$(BDB_UTILS): RPATH_DIRS=$(BDBDIR)/lib
endif
ifeq ($(DEBUG),0)
WINDOWS_BDB_LIB_NAME=libdb.$(SOEXT)
$(WINDOWS_BDB_LIB_NAME):
cp $(BDBDIR)/lib/libdb[0-9][0-9].$(SOEXT) ./
else
WINDOWS_BDB_LIB_NAME=libdbd.$(SOEXT)
$(WINDOWS_BDB_LIB_NAME):
cp $(BDBDIR)/lib/libdb[0-9][0-9]d.$(SOEXT) ./
endif
$(BDB_UTILS): DLINK_FILES=$(BDBDIR)/lib/$(WINDOWS_BDB_LIB_NAME)
#empty
else
WINDOWS_BDB_LIB_NAME=
#linux
ifdef BDBDIR
$(BDB_UTILS): INCLUDEDIRS=-I$(BDBDIR)/include
$(BDB_UTILS): RPATH_DIRS=$(BDBDIR)/lib
endif
$(BDB_UTILS): DLINK_FILES=db.$(SOEXT)
endif
$(BDB_UTILS): CPPFLAGS+=-DTOKU_ALLOW_DEPRECATED
$(BDB_UTILS): LDLIBS+=-ltokuportability
$(BDB_UTILS): LDFLAGS+=-L$(TOKUROOT)lib -Wl,-rpath,$(shell pwd)/$(TOKUROOT)lib
#empty on purpose
$(BDB_UTILS): CPPFLAGS+=-DIS_TDB=0
$(UTILS) $(STATIC_UTILS): CPPFLAGS+=-DIS_TDB=1
$(STATIC_UTILS): CPPFLAGS+=-DTDB_IS_STATIC=1
$(UTILS): CPPFLAGS+=-DTDB_IS_STATIC=0
HERE=utils
ifeq ($(SUMMARIZE),1)
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
else
SUMMARIZE_CMD =
endif
.PHONY: all clean test test_gen test_gen_hex test_load test_dump
build all: build.tdb build.bdb;
ifeq ($(OS_CHOICE),windows)
build.tdb: $(UTILS) copy.tdb;
build.bdb: $(BDB_UTILS) copy.bdb;
else
build.tdb: $(UTILS) $(STATIC_UTILS);
build.bdb: $(BDB_UTILS);
endif
copy.tdb: $(PTHREAD_LOCAL)
cp ../lib/*.dll ./
copy.bdb:
cp $(BDBDIR)/lib/*.dll ./
coverage: $(UTILS)
%$(BINSUF): %.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST) -DUSE_TDB=1
%.bdb$(BINSUF): %.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST) -DUSE_BDB=1
%_static$(BINSUF): %.c $(TOKUROOT)lib/libtokuportability.$(AEXT)
$(CC) $< $(BIN_FROM_C_FLAGS) $(TOKUROOT)lib/libtokuportability.$(AEXT) $(LINK_MUST_BE_LAST)
strip: $(STATIC_UTILS)
strip $(STATIC_UTILS)
check: build test_gen test_load test_dump test_nodup
test-coverage: $(UTILS) test_gen test_load test_dump test_nodup
test_gen: test_gen_hex
TEST_GEN_HEX_NUMKEYS=10000
TEST_GEN_HEX_LENGTHMIN=0
TEST_GEN_HEX_LENGTHLIMIT=1024
TEST_GEN_HEX_FLAGS=-n $(TEST_GEN_HEX_NUMKEYS) -m $(TEST_GEN_HEX_LENGTHMIN) -M $(TEST_GEN_HEX_LENGTHLIMIT) -r 5
TDB_GEN=./tokudb_gen$(BINSUF)
TDB_LOAD=./tokudb_load$(BINSUF) -h dir.$@.tdb
TDB_DUMP=./tokudb_dump$(BINSUF) -h dir.$@.tdb
TDB_DUMPBDB=./tokudb_dump.bdb$(BINSUF) -h dir.$@.bdb
ifeq ($(OS_CHOICE),windows)
LINEEND = "\r\n"
TO_NATIVE = unix2dos --u2d
else
LINEEND = "\n"
TO_NATIVE = cat
endif
test_gen_hex: build
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
@#echo "Generating text input > db > text"
rm -rf dir.$@.*
mkdir dir.$@.tdb
mkdir dir.$@.bdb
$(TDB_GEN) $(TEST_GEN_HEX_FLAGS) > $@.gen.temp && \
$(BDB_LOAD) $@.db.temp < $@.gen.temp && \
$(BDB_DUMP) $@.db.temp > $@.load_dump.temp && \
$(TDB_GEN) -H -f > $@.gen_sorted.temp && \
export LC_ALL=C;$(TDB_GEN) -h -f $(TEST_GEN_HEX_FLAGS) -d "\t" -s "\n" | sort -k 1,1 | tr -d $(LINEEND) | tr "\t" "\n" | $(TO_NATIVE) >> $@.gen_sorted.temp && \
$(TDB_GEN) -F -h >> $@.gen_sorted.temp && \
$(DIFF) $@.load_dump.temp $@.gen_sorted.temp \
$(SUMMARIZE_CMD)
test_load: test_load_hex test_load_text test_load_text_noendline
test_load_hex: build
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
@#echo "Generating text input > db > text"
rm -rf dir.$@.*
mkdir dir.$@.tdb
mkdir dir.$@.bdb
$(TDB_GEN) $(TEST_GEN_HEX_FLAGS) > $@.gen.temp && \
$(BDB_LOAD) $@.bdb.temp < $@.gen.temp && \
$(TDB_LOAD) $@.tokudb.temp < $@.gen.temp && \
$(BDB_DUMP) $@.bdb.temp > $@.dump.bdb.temp && \
$(TDB_DUMP) $@.tokudb.temp > $@.dump.tokudb.temp && \
$(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp \
$(SUMMARIZE_CMD)
TEST_GEN_TEXT_FLAGS=-n $(TEST_GEN_HEX_NUMKEYS) -m $(TEST_GEN_HEX_LENGTHMIN) -M $(TEST_GEN_HEX_LENGTHLIMIT) -r 5 -T -P
test_load_text: build
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
@#echo "Generating text input > db > text"
rm -rf dir.$@.*
mkdir dir.$@.tdb
mkdir dir.$@.bdb
$(TDB_GEN) $(TEST_GEN_TEXT_FLAGS) > $@.gen.temp && \
$(BDB_LOAD) -T -t btree $@.bdb.temp < $@.gen.temp && \
$(TDB_LOAD) -T -t btree $@.tokudb.temp < $@.gen.temp && \
$(BDB_DUMP) -p $@.bdb.temp > $@.dump.bdb.temp && \
$(TDB_DUMP) -p $@.tokudb.temp > $@.dump.tokudb.temp && \
$(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp \
$(SUMMARIZE_CMD)
test_load_text_noendline: build
@#echo "Testing no end of line at end of file."
rm -rf dir.$@.*
mkdir dir.$@.tdb
mkdir dir.$@.bdb
echo -en "key\nvalue" > $@.gen.temp
$(TDB_LOAD) -T -t btree $@.tokudb.temp < $@.gen.temp $(SUMMARIZE_CMD)
test_dump: build
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
@#echo "Generating text input > db > text"
rm -rf dir.$@.*
mkdir dir.$@.tdb
mkdir dir.$@.bdb
$(TDB_GEN) $(TEST_GEN_HEX_FLAGS) > $@.gen.temp && \
$(BDB_LOAD) $@.bdb.temp < $@.gen.temp && \
$(BDB_DUMP) $@.bdb.temp > $@.dump.bdb.temp && \
$(TDB_DUMPBDB) $@.bdb.temp > $@.dump.tokudb.temp && \
$(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp \
$(SUMMARIZE_CMD)
test_nodup: build
rm -rf dir.$@.*
mkdir dir.$@.tdb
mkdir dir.$@.bdb
$(TDB_GEN) $(TEST_GEN_HEX_FLAGS) >$@.gen.temp && \
$(BDB_LOAD) $@.bdb.temp <$@.gen.temp && \
$(BDB_DUMP) $@.bdb.temp >$@.dump.bdb.temp && \
$(TDB_LOAD) $@.tdb.temp <$@.gen.temp && \
$(TDB_DUMP) $@.tdb.temp >$@.dump.tdb.temp && \
$(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp && \
$(TDB_LOAD) $@.tdb.temp <$@.gen.temp && \
$(TDB_DUMP) $@.tdb.temp >$@.dump.tdb.temp && \
$(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp \
$(SUMMARIZE_CMD)
#if $(DIFF) -q <(echo "foo") <(echo "foo") > /dev/null; then echo yes; else echo no; fi
clean:
rm -rf *.so *.o $(UTILS) $(BDB_UTILS) $(STATIC_UTILS) *.temp *.gcno *.gcda *.gcov *.temp.clean *.temp.dirty
rm -rf tokudb.directory tokudb.environment *.log *.tokudb *.tokulog
rm -rf dir.*
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment