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
|
2008-03-06 16:35:18 +00:00
|
|
|
# PROF_FLAGS = -pg
|
2008-05-07 00:46:02 +00:00
|
|
|
OPTFLAGS = -O3
|
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
|
2008-04-02 23:40:36 +00:00
|
|
|
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes
|
2007-08-09 13:35:23 +00:00
|
|
|
endif
|
|
|
|
|
2008-04-02 23:40:36 +00:00
|
|
|
CFLAGS = -Wall -W -Wcast-align -Wbad-function-cast -Wextra -Wmissing-noreturn -Wmissing-format-attribute $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) -Wshadow -fvisibility=hidden
|
2008-05-08 14:31:05 +00:00
|
|
|
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz
|
2008-05-04 16:56:15 +00:00
|
|
|
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500
|
2007-08-09 13:35:23 +00:00
|
|
|
|
2008-05-08 20:30:33 +00:00
|
|
|
# Add -Wconversion
|
2008-04-04 18:22:01 +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
|
|
|
|
|
2008-05-08 20:30:33 +00:00
|
|
|
BINS= brtdump \
|
|
|
|
tdb_logprint \
|
|
|
|
# Intentionally left blank
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2008-05-08 20:30:33 +00:00
|
|
|
build default: bins libs tdb-recover tdb_logprint $(TEST_OFILES)
|
|
|
|
cd tests;$(MAKE) build
|
2007-08-24 18:38:11 +00:00
|
|
|
|
2008-07-09 12:00:26 +00:00
|
|
|
# Put crc first to make -combine work right
|
2008-05-08 14:31:05 +00:00
|
|
|
BRT_SOURCES = \
|
|
|
|
crc \
|
2008-07-09 12:00:26 +00:00
|
|
|
bread \
|
2008-05-08 14:31:05 +00:00
|
|
|
brt-serialize \
|
|
|
|
brt-verify \
|
|
|
|
brt \
|
|
|
|
cachetable \
|
|
|
|
fifo \
|
|
|
|
fingerprint \
|
|
|
|
key \
|
|
|
|
leafentry \
|
|
|
|
log \
|
|
|
|
log_code \
|
|
|
|
memory \
|
|
|
|
mempool \
|
|
|
|
omt \
|
|
|
|
recover \
|
|
|
|
roll \
|
|
|
|
toku_assert \
|
|
|
|
ybt \
|
2008-04-04 18:03:03 +00:00
|
|
|
# keep this line so I can ha vea \ on the previous line
|
|
|
|
|
2008-05-08 14:31:05 +00:00
|
|
|
OFILES = newbrt.o
|
2008-05-08 20:30:33 +00:00
|
|
|
TEST_OFILES = brt-test-helpers.o
|
2008-04-04 18:03:03 +00:00
|
|
|
|
2008-05-08 14:31:05 +00:00
|
|
|
HFILES = $(wildcard *.h)
|
|
|
|
|
|
|
|
BRT_C_FILES = $(patsubst %,%.c,$(BRT_SOURCES))
|
|
|
|
|
|
|
|
newbrt.o: $(BRT_C_FILES) $(HFILES)
|
|
|
|
$(CC) -combine $(CFLAGS) $(CPPFLAGS) $(BRT_C_FILES) -c -o $@
|
2008-04-04 18:03:03 +00:00
|
|
|
|
2008-05-08 07:16:26 +00:00
|
|
|
tdb_logprint.o: log-internal.h brttypes.h log.h kv-pair.h log_header.h
|
2008-04-04 18:03:03 +00:00
|
|
|
tdb_logprint: $(OFILES)
|
2007-11-23 18:27:50 +00:00
|
|
|
|
2008-05-08 07:16:26 +00:00
|
|
|
recover.o: log_header.h log-internal.h log.h brttypes.h kv-pair.h memory.h key.h cachetable.h
|
2008-04-04 18:03:03 +00:00
|
|
|
tdb-recover: $(OFILES)
|
2008-01-11 03:09:14 +00:00
|
|
|
|
2008-07-09 12:00:26 +00:00
|
|
|
roll.o: log_header.h log-internal.h log.h brttypes.h kv-pair.h memory.h key.h cachetable.h omt.h bread.h
|
2007-11-14 22:32:53 +00:00
|
|
|
|
2008-04-21 04:22:45 +00:00
|
|
|
log_code.o: log_header.h wbuf.h log-internal.h rbuf.h
|
2008-03-12 17:55:11 +00:00
|
|
|
log_header.h: log_code.c
|
|
|
|
@echo generated log_code.c so log_header.c was also generated
|
|
|
|
log_code.c: logformat
|
2007-11-22 07:13:08 +00:00
|
|
|
./logformat
|
|
|
|
|
2008-05-08 14:31:05 +00:00
|
|
|
libs: newbrt.o
|
2007-07-13 19:37:47 +00:00
|
|
|
bins: $(BINS)
|
2008-04-03 20:24:47 +00:00
|
|
|
# Put the benchmarktest_256 first since it takes the longest (and we want to use parallelism in the make)
|
2008-02-07 16:35:39 +00:00
|
|
|
|
2008-03-06 21:46:57 +00:00
|
|
|
# Put check_benchmarktest_256 first because it is long-running (and therefore on the critical path, so get it started)
|
2008-05-08 20:30:33 +00:00
|
|
|
check: bins
|
|
|
|
cd tests;$(MAKE) check
|
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-05-08 07:16:26 +00:00
|
|
|
BRT_INTERNAL_H_INCLUDES = brt-internal.h cachetable.h fifo.h omt.h brt.h brt-search.h brttypes.h ybt.h log.h ../include/db.h kv-pair.h memory.h crc.h mempool.h leafentry.h
|
2008-04-04 18:03:03 +00:00
|
|
|
brt-test-helpers.o: $(BRT_INTERNAL_H_INCLUDES) toku_assert.h
|
2008-05-08 14:31:05 +00:00
|
|
|
logformat: logformat.c toku_assert.c
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-serialize-test.o: $(BRT_INTERNAL_H_INCLUDES)
|
2008-05-08 14:31:05 +00:00
|
|
|
fifo-test: newbrt.o
|
2008-05-04 16:56:15 +00:00
|
|
|
log-test6 log-test5 log-test4 log-test3 log-test2 log-test: $(OFILES)
|
2008-04-22 20:39:50 +00:00
|
|
|
omt-test.o: toku_assert.h memory.h toku_assert.h ../include/db.h brttypes.h
|
2008-05-08 14:31:05 +00:00
|
|
|
omt-test: omt-test.o newbrt.o
|
2007-11-14 17:58:38 +00:00
|
|
|
|
2008-05-08 14:31:05 +00:00
|
|
|
test_toku_malloc_plain_free: newbrt.o
|
2007-07-13 19:37:47 +00:00
|
|
|
|
|
|
|
|
2007-10-05 14:46:49 +00:00
|
|
|
cachetable-test.o: cachetable.h memory.h
|
2008-04-17 03:11:55 +00:00
|
|
|
cachetable-test: $(OFILES)
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2007-09-12 18:12:31 +00:00
|
|
|
cachetable-test2.o: cachetable.h memory.h
|
2008-04-17 03:11:55 +00:00
|
|
|
cachetable-test2: $(OFILES)
|
2007-09-12 18:12:31 +00:00
|
|
|
|
2008-05-08 14:31:05 +00:00
|
|
|
test-assert: newbrt.o
|
2008-01-17 19:35:12 +00:00
|
|
|
|
2008-04-04 18:03:03 +00:00
|
|
|
brtdump: $(OFILES)
|
2008-01-18 16:01:25 +00:00
|
|
|
|
2008-05-08 14:31:05 +00:00
|
|
|
test_oexcl: test_oexcl.o newbrt.o
|
2008-02-08 03:17:38 +00:00
|
|
|
|
|
|
|
|
2007-12-06 20:52:23 +00:00
|
|
|
checko2:
|
2008-05-07 00:46:02 +00:00
|
|
|
ifeq ($(OPTFLAGS),-O3)
|
2007-12-06 20:52:23 +00:00
|
|
|
@echo OPTFLAGS=$(OPTFLAGS) ok
|
|
|
|
else
|
|
|
|
@echo OPTFLAGS=$(OPTFLAGS) bad; exit 1
|
|
|
|
endif
|
|
|
|
|
2008-05-12 10:58:07 +00:00
|
|
|
clean: clean-local clean-tests
|
|
|
|
clean-tests:
|
|
|
|
cd tests;$(MAKE) clean
|
|
|
|
clean-local:
|
2008-04-03 20:24:47 +00:00
|
|
|
rm -rf $(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
|
|
|
|
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
|