2007-08-09 13:35:23 +00:00
|
|
|
# On cygwin do:
|
|
|
|
# make CYGWIN=cygwin check
|
|
|
|
|
2007-12-22 20:56:20 +00:00
|
|
|
# For verbose output do
|
|
|
|
# make VERBOSE=1
|
|
|
|
# For very verbose output do
|
|
|
|
# make VERBOSE=2
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
|
2007-08-01 20:53:40 +00:00
|
|
|
# PROF_FLAGS = -pg
|
2008-02-05 18:25:23 +00:00
|
|
|
# OPTFLAGS = -O2
|
2007-08-09 13:35:23 +00:00
|
|
|
|
2007-12-22 20:56:20 +00:00
|
|
|
ifeq ($(VERBOSE),2)
|
|
|
|
VERBVERBOSE=-v
|
|
|
|
MAYBEATSIGN=
|
|
|
|
else
|
|
|
|
ifeq ($(VERBOSE),1)
|
|
|
|
VERBVERBOSE=-q
|
|
|
|
MAYBEATSIGN=
|
|
|
|
else
|
|
|
|
VERBVERBOSE=-q
|
|
|
|
MAYBEATSIGN=@
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-08-09 13:35:23 +00:00
|
|
|
ifeq ($(CYGWIN),cygwin)
|
|
|
|
else
|
|
|
|
FPICFLAGS = -fPIC
|
|
|
|
# valgrind is not present on cygwin
|
2007-11-16 15:37:35 +00:00
|
|
|
DTOOL = valgrind --quiet --error-exitcode=1 --leak-check=yes
|
2007-08-09 13:35:23 +00:00
|
|
|
endif
|
|
|
|
|
2008-02-05 22:30:01 +00:00
|
|
|
CFLAGS = -Wall -W $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) -Wshadow
|
2007-08-09 13:35:23 +00:00
|
|
|
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS)
|
2007-10-19 17:05:10 +00:00
|
|
|
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
2007-08-09 13:35:23 +00:00
|
|
|
|
2007-08-25 21:58:25 +00:00
|
|
|
ifdef BRT_FANOUT
|
|
|
|
CPPFLAGS += -DBRT_FANOUT=$(BRT_FANOUT)
|
|
|
|
endif
|
|
|
|
|
2007-08-01 02:37:21 +00:00
|
|
|
|
|
|
|
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2007-11-25 15:10:26 +00:00
|
|
|
default: bins libs recover tdb_logprint
|
2007-08-24 18:38:11 +00:00
|
|
|
# Put these one-per-line so that if we insert a new one the svn diff can understand it better.
|
|
|
|
# Also keep them sorted.
|
2007-09-12 18:12:31 +00:00
|
|
|
REGRESSION_TESTS = \
|
|
|
|
ybt-test \
|
|
|
|
pma-test \
|
2007-08-24 18:38:11 +00:00
|
|
|
brt-serialize-test \
|
|
|
|
cachetable-test \
|
2007-09-12 18:12:31 +00:00
|
|
|
cachetable-test2 \
|
2008-01-11 22:18:39 +00:00
|
|
|
fifo-test \
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-test \
|
2007-11-18 12:48:36 +00:00
|
|
|
test_oexcl \
|
2008-01-17 19:35:12 +00:00
|
|
|
test-primes \
|
2008-01-18 15:26:17 +00:00
|
|
|
list-test \
|
2007-09-12 18:12:31 +00:00
|
|
|
# This line intentially kept commented so I can have a \ on the end of the previous line
|
|
|
|
|
|
|
|
BINS = $(REGRESSION_TESTS) \
|
|
|
|
benchmark-test \
|
2007-08-24 18:38:11 +00:00
|
|
|
randbrt \
|
|
|
|
randdb4 \
|
2007-11-24 23:48:34 +00:00
|
|
|
tdb_logprint \
|
2007-12-10 11:28:00 +00:00
|
|
|
test_toku_malloc_plain_free \
|
2007-09-12 18:12:31 +00:00
|
|
|
# This line intentially kept commented so I can have a \ on the end of the previous line
|
2007-08-24 18:38:11 +00:00
|
|
|
|
2007-11-24 23:48:34 +00:00
|
|
|
tdb_logprint: LDFLAGS+=-lz
|
2007-11-26 18:47:44 +00:00
|
|
|
tdb_logprint.o: log-internal.h brttypes.h yerror.h log.h kv-pair.h
|
2008-01-11 14:03:33 +00:00
|
|
|
tdb_logprint: log_code.o memory.o log.o brt-serialize.o fifo.o pma.o ybt.o fingerprint.o mempool.o primes.o roll.o brt.o cachetable.o brt-verify.o key.o
|
2007-11-23 18:27:50 +00:00
|
|
|
|
|
|
|
recover: LDFLAGS+=-lz
|
2007-11-23 20:36:03 +00:00
|
|
|
recover.o: log_header.h log-internal.h log.h yerror.h brttypes.h kv-pair.h memory.h key.h
|
2008-01-11 14:03:33 +00:00
|
|
|
recover: recover.o log_code.o memory.o log.o brt-serialize.o fifo.o pma.o ybt.o fingerprint.o mempool.o primes.o cachetable.o brt.o brt-verify.o key.o roll.o
|
2008-01-11 03:09:14 +00:00
|
|
|
|
2008-01-16 15:41:12 +00:00
|
|
|
roll.o: log_header.h log-internal.h log.h yerror.h brttypes.h kv-pair.h memory.h key.h cachetable.h pma.h
|
2007-11-14 22:32:53 +00:00
|
|
|
|
2007-12-04 16:16:30 +00:00
|
|
|
log_code.o: log_header.h wbuf.h log-internal.h
|
2007-11-22 07:13:08 +00:00
|
|
|
log_code.c log_header.h: logformat
|
|
|
|
./logformat
|
|
|
|
|
2007-09-28 17:11:22 +00:00
|
|
|
libs: log.o
|
2007-07-13 19:37:47 +00:00
|
|
|
bins: $(BINS)
|
2007-12-22 18:40:22 +00:00
|
|
|
CHECKS = \
|
|
|
|
test_oexcl \
|
|
|
|
ybt-test \
|
|
|
|
pma-test \
|
|
|
|
cachetable-test \
|
|
|
|
cachetable-test2 \
|
|
|
|
brt-serialize-test \
|
2008-01-11 22:18:39 +00:00
|
|
|
brt-test fifo-test \
|
2008-01-17 19:35:12 +00:00
|
|
|
test_toku_malloc_plain_free \
|
2008-01-18 15:26:17 +00:00
|
|
|
test-primes \
|
|
|
|
list-test
|
2007-12-22 18:40:22 +00:00
|
|
|
check: bins $(patsubst %,check_%,$(CHECKS)) check_benchmarktest_256
|
|
|
|
check_benchmarktest_256: benchmark-test
|
2007-12-22 20:56:20 +00:00
|
|
|
$(DTOOL) ./benchmark-test $(VERBVERBOSE) --valsize 256 --verify 1
|
2007-12-22 18:40:22 +00:00
|
|
|
|
|
|
|
check_%: %
|
2007-12-22 20:56:20 +00:00
|
|
|
$(DTOOL) ./$< $(VERBVERBOSE)
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2007-08-25 21:58:25 +00:00
|
|
|
check-fanout:
|
|
|
|
let BRT_FANOUT=4; \
|
|
|
|
while [ $$BRT_FANOUT -le 16 ] ;do \
|
|
|
|
make clean; make check BRT_FANOUT=$$BRT_FANOUT; \
|
|
|
|
let BRT_FANOUT=BRT_FANOUT+1; \
|
|
|
|
done
|
|
|
|
|
2008-01-18 16:01:25 +00:00
|
|
|
pma-test benchmark-test brt-test brt-serialize-test brtdump: LDFLAGS+=-lz
|
2007-07-13 19:37:47 +00:00
|
|
|
# pma: PROF_FLAGS=-fprofile-arcs -ftest-coverage
|
2007-11-14 17:58:38 +00:00
|
|
|
|
2008-01-11 14:03:33 +00:00
|
|
|
BRT_INTERNAL_H_INCLUDES = brt-internal.h cachetable.h fifo.h pma.h brt.h brttypes.h yerror.h ybt.h log.h ../include/db.h kv-pair.h memory.h crc.h
|
2007-07-13 19:37:47 +00:00
|
|
|
key.o: brttypes.h key.h
|
2007-11-14 17:58:38 +00:00
|
|
|
pma-test.o: $(BRT_INTERNAL_H_INCLUDES) pma-internal.h pma.h list.h mempool.h
|
2008-01-11 14:03:33 +00:00
|
|
|
pma-test: pma.o memory.o key.o ybt.o log.o mempool.o fingerprint.o brt-serialize.o fifo.o primes.o log_code.o roll.o brt.o cachetable.o brt-verify.o
|
2007-11-26 21:51:36 +00:00
|
|
|
pma.o: pma.h yerror.h pma-internal.h memory.h key.h ybt.h brttypes.h log.h ../include/db.h log_header.h
|
2007-09-06 20:13:56 +00:00
|
|
|
ybt.o: ybt.h brttypes.h ../include/db.h
|
2007-07-13 19:37:47 +00:00
|
|
|
ybt-test: ybt-test.o ybt.o memory.o
|
2007-09-06 20:13:56 +00:00
|
|
|
ybt-test.o: ybt.h ../include/db.h
|
2007-11-29 15:34:49 +00:00
|
|
|
cachetable.o: cachetable.h hashfun.h memory.h
|
2008-01-11 14:03:33 +00:00
|
|
|
brt-test: ybt.o brt.o fifo.o pma.o memory.o brt-serialize.o cachetable.o ybt.o key.o primes.o log.o mempool.o brt-verify.o fingerprint.o log_code.o roll.o
|
2007-11-23 17:41:02 +00:00
|
|
|
log.o: log_header.h log-internal.h log.h wbuf.h crc.h brttypes.h $(BRT_INTERNAL_H_INCLUDES)
|
2008-01-11 14:03:33 +00:00
|
|
|
brt-test.o brt.o: brt.h ../include/db.h fifo.h pma.h brttypes.h cachetable.h memory.h
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-serialize-test.o: $(BRT_INTERNAL_H_INCLUDES)
|
2007-11-24 03:50:28 +00:00
|
|
|
brt.o: $(BRT_INTERNAL_H_INCLUDES) key.h log_header.h
|
2008-01-11 14:03:33 +00:00
|
|
|
fifo.o: fifo.h brttypes.h
|
2007-07-13 19:37:47 +00:00
|
|
|
memory.o: memory.h
|
2007-08-13 21:53:19 +00:00
|
|
|
primes.o: primes.h
|
2008-01-11 22:18:39 +00:00
|
|
|
fifo-test: fifo.o memory.o
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-serialize.o: $(BRT_INTERNAL_H_INCLUDES) key.h wbuf.h rbuf.h
|
2008-01-11 14:03:33 +00:00
|
|
|
brt-bigtest: memory.o ybt.o brt.o pma.o cachetable.o key.o fifo.o brt-serialize.o
|
2007-09-06 20:13:56 +00:00
|
|
|
brt-bigtest.o: brt.h ../include/db.h
|
2007-08-10 21:15:17 +00:00
|
|
|
log-test: log.o memory.o
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-verify.o: $(BRT_INTERNAL_H_INCLUDES)
|
|
|
|
fingerprint.o: $(BRT_INTERNAL_H_INCLUDES)
|
|
|
|
|
2008-01-11 14:03:33 +00:00
|
|
|
brt-serialize-test: brt-serialize-test.o brt-serialize.o memory.o fifo.o pma.o key.o ybt.o brt.o cachetable.o primes.o log.o mempool.o brt-verify.o fingerprint.o log_code.o roll.o
|
2007-12-10 11:28:00 +00:00
|
|
|
test_toku_malloc_plain_free: memory.o
|
2007-07-13 19:37:47 +00:00
|
|
|
|
|
|
|
|
2007-10-05 14:46:49 +00:00
|
|
|
cachetable-test.o: cachetable.h memory.h
|
|
|
|
cachetable-test: cachetable.o memory.o cachetable-test.o primes.o
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2007-09-12 18:12:31 +00:00
|
|
|
cachetable-test2.o: cachetable.h memory.h
|
2007-10-05 14:46:49 +00:00
|
|
|
cachetable-test2: cachetable.o memory.o cachetable-test2.o primes.o
|
2007-09-12 18:12:31 +00:00
|
|
|
|
2008-01-11 14:03:33 +00:00
|
|
|
benchmark-test: benchmark-test.o ybt.o memory.o brt.o pma.o cachetable.o key.o fifo.o brt-serialize.o primes.o log.o mempool.o brt-verify.o fingerprint.o log_code.o roll.o
|
2007-09-06 20:13:56 +00:00
|
|
|
benchmark-test.o: brt.h ../include/db.h
|
2007-08-01 20:53:18 +00:00
|
|
|
|
2008-01-17 19:35:12 +00:00
|
|
|
test-primes: test-primes.o primes.o
|
|
|
|
|
2008-01-18 16:01:25 +00:00
|
|
|
brtdump: brtdump.o brt-serialize.o memory.o pma.o key.o fingerprint.o log.o log_code.o roll.o cachetable.o primes.o brt.o ybt.o fifo.o mempool.o brt-verify.o
|
|
|
|
|
2007-12-06 20:52:23 +00:00
|
|
|
checko2:
|
|
|
|
ifeq ($(OPTFLAGS),-O2)
|
|
|
|
@echo OPTFLAGS=$(OPTFLAGS) ok
|
|
|
|
else
|
|
|
|
@echo OPTFLAGS=$(OPTFLAGS) bad; exit 1
|
|
|
|
endif
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
clean:
|
2008-01-17 16:00:45 +00:00
|
|
|
rm -rf $(REGRESSION_TESTS) $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda
|
2008-01-02 11:37:16 +00:00
|
|
|
rm -rf test_oexcl.c.tmp *.brt
|
2007-07-13 19:37:47 +00:00
|
|
|
|
|
|
|
randdb4: LOADLIBES=-ldb
|
2008-01-11 14:03:33 +00:00
|
|
|
randbrt: brt.o fifo.o cachetable.o memory.o brt-serialize.o
|
2008-01-22 19:30:02 +00:00
|
|
|
|
|
|
|
# After doing (cd ../src/tests;make test_log5.recover), run these. The files should have no differences.
|
|
|
|
testdump: brtdump
|
|
|
|
./brtdump ../src/tests/dir.test_log5.c.tdb.recover/foo.db > dump.r && ./brtdump ../src/tests/dir.test_log5.c.tdb/foo.db > dump.o && diff dump.o dump.r
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
TAGS: ../*/*.c ../*/*.h
|
|
|
|
etags ../*/*.c ../*/*.h
|