2013-04-16 23:57:27 -04:00
|
|
|
# -*- Mode: Makefile -*-
|
2007-08-09 13:35:23 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
.DEFAULT_GOAL= build
|
|
|
|
TOKUROOT=../
|
|
|
|
INCLUDEDIRS=-I.
|
|
|
|
COMBINE=1
|
|
|
|
#TODO: Replace DEPEND_COMPILE with auto-dependancy generation.
|
|
|
|
DEPEND_COMPILE += \
|
|
|
|
$(wildcard *.h) \
|
|
|
|
log_header.h \
|
|
|
|
# keep this line so I can have a \ on the previous line
|
2007-12-22 20:56:20 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
NEWBRT = newbrt.$(AEXT)
|
2013-04-16 23:57:40 -04:00
|
|
|
IPO_NEWBRT = ipo_newbrt.$(AEXT)
|
2013-04-16 23:57:31 -04:00
|
|
|
NEWBRT_BUNDLE = newbrt.bundle
|
2013-04-16 23:57:27 -04:00
|
|
|
#All executables need to statically link to newbrt
|
|
|
|
LINK_FILES += $(NEWBRT)
|
2013-04-16 23:57:20 -04:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
SKIP_NEWBRTRULE=1
|
2013-04-16 23:57:37 -04:00
|
|
|
include $(TOKUROOT)toku_include/Makefile.include
|
2007-08-09 13:35:23 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
|
2008-04-04 18:22:01 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
BINS_RAW= \
|
|
|
|
brtdump \
|
|
|
|
tdb_logprint \
|
|
|
|
tdb-recover \
|
|
|
|
# Intentionally left blank
|
|
|
|
# BINS will be defined automatically.
|
2007-08-25 21:58:25 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
BINS_O = $(patsubst %,%.$(OEXT),$(BINS_RAW))
|
2007-08-01 02:37:21 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
.PHONY: build default bins libs
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2013-04-16 23:57:40 -04:00
|
|
|
build default: bins libs $(TEST_NEWBRT)
|
2013-04-16 23:57:34 -04:00
|
|
|
cd tests;$(MAKE) build
|
2007-08-24 18:38:11 +00:00
|
|
|
|
2008-05-08 14:31:05 +00:00
|
|
|
BRT_SOURCES = \
|
2013-04-16 23:57:18 -04:00
|
|
|
block_allocator \
|
2013-04-16 23:57:41 -04:00
|
|
|
block_table \
|
2008-07-09 12:00:26 +00:00
|
|
|
bread \
|
2008-05-08 14:31:05 +00:00
|
|
|
brt-serialize \
|
|
|
|
brt-verify \
|
|
|
|
brt \
|
2013-04-16 23:57:27 -04:00
|
|
|
brt-test-helpers \
|
2008-05-08 14:31:05 +00:00
|
|
|
cachetable \
|
|
|
|
fifo \
|
|
|
|
fingerprint \
|
|
|
|
key \
|
|
|
|
leafentry \
|
2013-04-16 23:57:41 -04:00
|
|
|
leaflock \
|
2008-05-08 14:31:05 +00:00
|
|
|
log \
|
|
|
|
log_code \
|
2008-07-11 22:00:06 +00:00
|
|
|
memarena \
|
2008-05-08 14:31:05 +00:00
|
|
|
mempool \
|
|
|
|
omt \
|
|
|
|
recover \
|
|
|
|
roll \
|
2013-04-16 23:57:27 -04:00
|
|
|
threadpool \
|
2013-04-16 23:57:38 -04:00
|
|
|
toku_worker \
|
2008-07-24 21:23:40 +00:00
|
|
|
trace_mem \
|
2013-04-16 23:57:27 -04:00
|
|
|
x1764 \
|
|
|
|
ybt \
|
|
|
|
# keep this line so I can have a \ on the previous line
|
2008-04-04 18:03:03 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
TEST_NEWBRT = brt-test-helpers.$(OEXT)
|
2008-05-08 14:31:05 +00:00
|
|
|
|
|
|
|
BRT_C_FILES = $(patsubst %,%.c,$(BRT_SOURCES))
|
2013-04-16 23:57:27 -04:00
|
|
|
BRT_O_FILES = $(patsubst %,%.$(OEXT),$(BRT_SOURCES))
|
2008-05-08 14:31:05 +00:00
|
|
|
|
2013-04-16 23:57:29 -04:00
|
|
|
newbrt.$(OEXT): $(BRT_C_FILES) $(DEPEND_COMPILE)
|
2013-04-16 23:57:37 -04:00
|
|
|
$(CC) -c $(BRT_C_FILES) $(COMBINE_C) $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
|
2007-11-23 18:27:50 +00:00
|
|
|
|
2008-01-11 03:09:14 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
ifneq ($(CYGWIN),)
|
2013-04-16 23:57:31 -04:00
|
|
|
NEWBRT_O_FILES = $(BRT_O_FILES)
|
2013-04-16 23:57:27 -04:00
|
|
|
else ifeq ($(CC),icc)
|
2013-04-16 23:57:31 -04:00
|
|
|
NEWBRT_O_FILES = $(BRT_O_FILES)
|
2013-04-16 23:57:27 -04:00
|
|
|
else ifeq ($(COMBINE),0)
|
2013-04-16 23:57:31 -04:00
|
|
|
NEWBRT_O_FILES = $(BRT_O_FILES)
|
2013-04-16 23:57:27 -04:00
|
|
|
else
|
2013-04-16 23:57:31 -04:00
|
|
|
NEWBRT_O_FILES = newbrt.o
|
2013-04-16 23:57:27 -04:00
|
|
|
endif
|
2007-11-14 22:32:53 +00:00
|
|
|
|
2013-04-16 23:57:31 -04:00
|
|
|
$(NEWBRT): $(NEWBRT_O_FILES)
|
|
|
|
|
2013-04-16 23:57:40 -04:00
|
|
|
ipo_newbrt.obj: $(NEWBRT_BUNDLE)
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -Qipo-c $(filter %.$(OEXT),$^) $(patsubst %.bundle, %.bundle/*.$(OEXT), $(filter-out %.$(OEXT),$^))
|
|
|
|
mv ipo_out.obj $@
|
|
|
|
|
|
|
|
$(IPO_NEWBRT): ipo_newbrt.obj
|
|
|
|
xilib /out:$@ $^
|
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
log_code.$(OEXT): log_header.h wbuf.h log-internal.h rbuf.h
|
2013-04-16 23:57:34 -04:00
|
|
|
log_header.h log_code.c: logformat$(BINSUF)
|
|
|
|
./logformat
|
2013-04-16 23:57:27 -04:00
|
|
|
#Needs to be done manually since it does not include newbrt.
|
|
|
|
logformat$(BINSUF): logformat.c $(LIBPORTABILITY)
|
2013-04-16 23:57:42 -04:00
|
|
|
$(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LIBPORTABILITY) $(LINK_MUST_BE_LAST)
|
2007-11-22 07:13:08 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
|
2013-04-16 23:57:31 -04:00
|
|
|
libs: $(NEWBRT) $(NEWBRT_BUNDLE)
|
2007-07-13 19:37:47 +00:00
|
|
|
bins: $(BINS)
|
2013-04-16 23:57:27 -04:00
|
|
|
|
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
|
2013-04-16 23:57:34 -04:00
|
|
|
cd tests;$(MAKE) check
|
2008-02-08 03:17:38 +00:00
|
|
|
|
2013-04-16 23:57:27 -04:00
|
|
|
%$(BINSUF): $(NEWBRT) $(LIBPORTABILITY)
|
2008-02-08 03:17:38 +00:00
|
|
|
|
2007-12-06 20:52:23 +00:00
|
|
|
checko2:
|
2013-04-16 23:57:31 -04:00
|
|
|
@if [[ "$(OPTFLAGS)" =~ "-O([2-3])" ]] ; then \
|
2013-04-16 23:57:31 -04:00
|
|
|
echo OPTFLAGS=$(OPTFLAGS) ok; \
|
|
|
|
else \
|
|
|
|
echo OPTFLAGS=$(OPTFLAGS) bad; exit 1; \
|
|
|
|
fi
|
2007-12-06 20:52:23 +00:00
|
|
|
|
2008-05-12 10:58:07 +00:00
|
|
|
clean: clean-local clean-tests
|
|
|
|
clean-tests:
|
2013-04-16 23:57:34 -04:00
|
|
|
cd tests;$(MAKE) clean
|
2008-05-12 10:58:07 +00:00
|
|
|
clean-local:
|
2013-04-16 23:57:34 -04:00
|
|
|
rm -rf $(NEWBRT)
|
|
|
|
rm -rf test_oexcl.c.tmp *.brt
|
|
|
|
rm -rf log_code.c log_header.h logformat
|
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.
|
2013-04-16 23:57:27 -04:00
|
|
|
testdump: brtdump$(BINSUF)
|
2013-04-16 23:57:34 -04:00
|
|
|
./brtdump ../src/tests/dir.test_log5.c.tdb.recover/foo.db > dump.r && ./brtdump ../src/tests/dir.test_log5.c.tdb/foo.db > dump.$(OEXT) && diff dump.$(OEXT) dump.r
|
2008-01-22 19:30:02 +00:00
|
|
|
|