Commit 891411a7 authored by Yoni Fogel's avatar Yoni Fogel

Updated makefiles to support tests

and easier compilation of non-linear range/lock trees.
Removed obsolete export maps.

git-svn-id: file:///svn/tokudb@2558 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5c52e7c6
......@@ -53,7 +53,7 @@ ydb.o: ../include/db.h ../newbrt/cachetable.h ../newbrt/brt.h ../newbrt/log.c
DBBINS = ydb.o errors.o elocks.o ../newbrt/brt.o ../newbrt/brt-serialize.o ../newbrt/brt-verify.o ../newbrt/cachetable.o ../newbrt/fifo.o ../newbrt/key.o ../newbrt/memory.o ../newbrt/mempool.o ../newbrt/pma.o ../newbrt/ybt.o ../newbrt/primes.o ../newbrt/log.o ../newbrt/fingerprint.o ../newbrt/log_code.o ../newbrt/roll.o ../newbrt/toku_assert.o
RANGETREE_BINS = range_tree/linear.o
RANGETREE_BINS = range_tree/rangetree.o
LOCKTREE_BINS = lock_tree/locktree.o lock_tree/rth.o lock_tree/lth.o $(RANGETREE_BINS)
......
......@@ -23,23 +23,38 @@ ifneq ($(OSX),)
CFLAGS+=-fno-common
endif
BINS=locktree.o rth.o lth.o
LT_OVERLAP = locktree_global_readset.o
LT_NOOVERLAP = locktree_no_global_readset.o
LT_LINEAR = $(LT_OVERLAP)
LT_TLINEAR = $(LT_NOOVERLAP)
LT_TLOG = $(LT_NOOVERLAP)
LT_LOG = $(LT_OVERLAP)
LT_BINS=$(LT_OVERLAP) $(LT_NOOVERLAP) locktree.o
BINS=rth.o lth.o
.PHONY: install logformat range_tree
install: range_tree $(BINS)
install: range_tree $(BINS) $(LT_BINS)
range_tree:
cd ../range_tree && make
clean:
cd ../range_tree && make clean
rm -rf *.o
rm -rf $(BINS) $(LT_BINS)
rm -rf *.gcno *.gcda *.gcov
cd tests && make clean
BINS = locktree.o rth.o lth.o
locktree.o: locktree.c locktree.h
locktree.o: $(LT_LINEAR)
cp $< $@
locktree_global_readset.o: locktree.c locktree.h
cc $(CFLAGS) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
locktree_no_global_readset.o: locktree.c locktree.h
cc $(CFLAGS) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ -DTOKU_RT_NOOVERLAPS
rth.o: rth.c rth.h
......
{
global:
toku_rt_get_allow_overlaps;
toku_rt_create;
toku_rt_close;
toku_rt_find;
toku_rt_insert;
toku_rt_delete;
toku_rt_predecessor;
toku_rt_successor;
toku_rt_get_size;
local: *;
};
......@@ -28,15 +28,17 @@ SRCS = $(wildcard *.c)
LOG_TESTS = $(patsubst %.c,%.log,$(SRCS))
TLOG_TESTS = $(patsubst %.c,%.tlog,$(SRCS))
LIN_TESTS = $(patsubst %.c,%.lin,$(SRCS))
TLIN_TESTS = $(patsubst %.c,%.tlin,$(SRCS))
ALL_TESTS = $(LIN_TESTS) $(TLOG_TESTS) $(LOG_TESTS)
ALL_TESTS = $(LIN_TESTS) $(TLIN_TESTS) $(TLOG_TESTS) $(LOG_TESTS)
RUN_LOG_TESTS = $(patsubst %.log,%.logrun,$(LOG_TESTS))
RUN_TLOG_TESTS = $(patsubst %.tlog,%.tlogrun,$(TLOG_TESTS))
RUN_LIN_TESTS = $(patsubst %.lin,%.linrun,$(LIN_TESTS))
RUN_ALL_TESTS = $(RUN_LIN_TESTS) $(RUN_TLOG_TESTS) $(RUN_LOG_TESTS)
RUN_TLIN_TESTS = $(patsubst %.tlin,%.tlinrun,$(TLIN_TESTS))
RUN_ALL_TESTS = $(RUN_LIN_TESTS) $(RUN_TLIN_TESTS) $(RUN_TLOG_TESTS) $(RUN_LOG_TESTS)
.PHONY: check default all check.lin check.log tests.lin tests.log check.tlog tests.tlog
.PHONY: check default all check.lin check.tlin check.log check.tlog tests.lin tests.tlin tests.tlog tests.log
default: check
......@@ -47,17 +49,17 @@ check: check.lin #check.tlog check.log
@ echo ok
tests.lin: make_libs $(LIN_TESTS)
check.lin: make_libs $(RUN_LIN_TESTS)
tests.tlin: make_libs $(TLIN_TESTS)
check.tlin: make_libs $(RUN_TLIN_TESTS)
tests.tlog: make_libs $(TLOG_TESTS)
check.tlog: make_libs $(RUN_TLOG_TESTS)
tests.log: make_libs $(LOG_TESTS)
check.log: make_libs $(RUN_LOG_TESTS)
# Need these rule so that Make knows about all the file names
.PHONY: %.linrun %.logrun %.run %.tlogrun
$(RUN_ALL_TESTS):
$(ALL_TESTS):
.PHONY: %.linrun %.tlinrun %.tlogrun %.logrun %.run
%.run: %.linrun %.tlogrun %.logrun
%.run: %.linrun %.tlinrun %.tlogrun %.logrun
@ echo ok
ifeq ($(VERBOSE),2)
......@@ -78,27 +80,40 @@ endif
# The @ sign makes the make quiet. If there is an error there is enough info to tell what test failed.
%.linrun: %.lin
$(MAYBEATSIGN) $(SETENV) $(VGRIND) ./$< $(VERBVERBOSE)
$(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE)
%.tlinrun: %.tlin
$(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE)
%.tlinrun: %.tlin
$(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE)
%.logrun: %.log
$(MAYBEATSIGN) $(SETENV) $(VGRIND) ./$< $(VERBVERBOSE)
$(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE)
%.tlogrun: %.tlog
$(MAYBEATSIGN) $(SETENV) $(VGRIND) ./$< $(VERBVERBOSE)
$(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE)
libs:
cd .. && make
RT_LINEAR_BINS = ../../range_tree/linear.o
RT_TLINEAR_BINS = ../../range_tree/linear.o
RT_TLOG_BINS = ../../range_tree/tlog.o
RT_LOG_BINS = ../../range_tree/log.o
LT_BINS = ../locktree.o ../lth.o ../rth.o
LT_BINS = ../lth.o ../rth.o
LT_OVERLAP = ../locktree_global_readset.o
LT_NOOVERLAP = ../locktree_no_global_readset.o
LT_LINEAR = $(LT_OVERLAP) $(LT_BINS) $(RT_LINEAR_BINS)
LT_TLINEAR = $(LT_NOOVERLAP) $(LT_BINS) $(RT_TLINEAR_BINS)
LT_TLOG = $(LT_NOOVERLAP) $(LT_BINS) $(RT_TLOG_BINS)
LT_LOG = $(LT_OVERLAP) $(LT_BINS) $(RT_LOG_BINS)
%.lin: %.c ../locktree.h test.h
cc -DDIR=\"dir.$<.lin\" -DTOKU_LT_LINEAR $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_BINS) $(RT_LINEAR_BINS)
cc -DDIR=\"dir.$<.lin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LINEAR)
%.tlin: %.c ../locktree.h test.h
cc -DDIR=\"dir.$<.tlin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LINEAR)
%.tlog: %.c ../locktree.h test.h
cc -DDIR=\"dir.$<.log\" -DTOKU_LT_TLOG $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_BINS) $(RT_TLOG_BINS)
cc -DDIR=\"dir.$<.tlog\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_TLOG)
%.log: %.c ../locktree.h test.h
cc -DDIR=\"dir.$<.log\" -DTOKU_LT_LOG $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_BINS) $(RT_LOG_BINS)
cc -DDIR=\"dir.$<.log\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LOG)
.PHONY: make_libs
......@@ -107,4 +122,4 @@ make_libs:
clean:
rm -f $(ALL_TESTS) *.o *.gcno *.gcda *.gcov
rm -rf dir.*.log dir.*.lin
rm -rf dir.*
......@@ -23,18 +23,17 @@ CFLAGS+=-fno-common
endif
.PHONY: install logformat
install: linear.o
install: linear.o rangetree.o #log_nooverlap.o log.o
clean:
rm -rf *.o *.gcno *.gcda *.gcov
cd tests && make clean
rangetree.o: linear.o
cp $< $@
linear.o: linear.c rangetree.h
log.o: log.c rangetree.h
gcc $(CFLAGS) $(CPPFLAGS) -c $< -o $@
tlog.o: tlog.c rangetree.h
gcc $(CFLAGS) $(CPPFLAGS) -c $< -o $@
log_nooverlap.o: log_nooverlap.c rangetree.h
{
global:
toku_rt_get_allow_overlaps;
toku_rt_create;
toku_rt_close;
toku_rt_find;
toku_rt_insert;
toku_rt_delete;
toku_rt_predecessor;
toku_rt_successor;
toku_rt_get_size;
local: *;
};
......@@ -80,7 +80,7 @@ endif
$(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE)
LINEAR_BINS = ../linear.o
TLOG_BINS = ../tlog.o
TLOG_BINS = ../log_nooverlap.o
LOG_BINS = ../log.o
%.lin: %.c ../rangetree.h test.h
......
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