Commit 95416f09 authored by Rich Prohaska's avatar Rich Prohaska

add GCOV_FLAGS var to Makefiles. addresses #277

git-svn-id: file:///svn/tokudb@1693 c7de825b-a66e-492c-adef-691d508d4ae1
parent 11e52586
# OPTFLAGS = -O2
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CPPFLAGS = -I../include
CXXFLAGS = -Wall -g
CXXFLAGS = -Wall -g $(OPTFLAGS) $(GCOV_FLAGS)
CC = c++
LDFLAGS = -lz
SRCS = $(wildcard *.cpp)
......@@ -16,6 +18,6 @@ test1: test1.o dbt.o db.o dbenv.o ../lib/libdb.a
$(LIBNAME).a: $(OBJS)
$(AR) rv $@ $(OBJS)
clean:
rm -f $(OBJS) $(LIBNAME).a $(LIBNAME).so
rm -f $(OBJS) $(LIBNAME).a $(LIBNAME).so *.gcno *.gcda *.gcov
SRCS = $(wildcard *.cpp)
TARGETS = $(patsubst %.cpp,%,$(SRCS))
# OPTFLAGS = -O0
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CPPFLAGS = -I../ -I../../include
CXXFLAGS = -Wall -g
CXXFLAGS = -Wall $(OPTFLAGS) -g $(GCOV_FLAGS)
LDLIBS = ../../lib/libtdb_cxx.a ../../lib/libdb.a -lz
ifeq ($(OSX),OSX)
......@@ -18,7 +20,7 @@ $(DBCXX):
cd ..;make
clean:
rm -rf $(TARGETS)
rm -rf $(TARGETS) *.gcno *.gcda *.gcov
check: $(TARGETS)
$(VGRIND) ./test1
......@@ -36,4 +38,5 @@ check: $(TARGETS)
$(VGRIND) ./test_db_assoc3 --more
$(VGRIND) ./test_cursor_count
$(VGRIND) ./test_fd
$(VGRIND) ./test_error_stream
......@@ -3,8 +3,9 @@
LIBNAME=libdb
# OPTFLAGS = -O2
CFLAGS = -W -Wall -Werror -g -fPIC $(OPTFLAGS)
OPTFLAGS = -O2
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CFLAGS = -W -Wall -Werror -g -fPIC $(OPTFLAGS) $(GCOV_FLAGS)
CPPFLAGS = -I../include -I../newbrt
CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
......@@ -33,7 +34,7 @@ strip: $(LIBNAME).$(LIBEXT)
strip $(LIBNAME).$(LIBEXT)
clean:
rm -rf $(LIBNAME).$(LIBEXT) $(LIBNAME).a *.o
rm -rf $(LIBNAME).$(LIBEXT) $(LIBNAME).a *.o *.gcno *.gcda *.gcov
cd tests;make clean
ydb.o: ../include/db.h ../newbrt/cachetable.h ../newbrt/brt.h ../newbrt/log.c
......
......@@ -38,10 +38,11 @@ endif
# VERBOSE=true
LIBNAME=libdb.$(LIBEXT)
CFLAGS = -Wall -Werror -O0 -g
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CFLAGS = -Wall -Werror $(OPTFLAGS) -g $(GCOV_FLAGS)
TDB_CPPFLAGS = -I../../include
SRCS = $(wildcard *.c)
TDB_TESTS = $(patsubst %.c,%.tdb,$(SRCS))
......@@ -64,6 +65,7 @@ foo:
check: check.bdb check.tdb all.recover test_db_assoc3.tdbrun_wasbad
@ echo ok
check.bdb: $(RUN_BDB_TESTS)
tests.tdb: $(TDB_TESTS)
check.tdb: $(RUN_TDB_TESTS)
# Need these rule so that Make knows about all the file names
......@@ -140,7 +142,7 @@ libs:
%.bdb: %.c
$(UNSETTOKUENV) cc -DDIR=\"dir.$<.bdb\" $(BDB_CPPFLAGS) -DUSE_BDB -DIS_TDB=0 $(CFLAGS) $< $(BDB_LDFLAGS) -ldb -o $@
%.tdb: %.c libs
%.tdb: %.c
$(SETTOKUENV) cc -DDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1 $(CFLAGS) $(TDB_CPPFLAGS) $(TDB_LOADLIBES) $< -o $@
.PHONY: %.recover
......@@ -157,7 +159,7 @@ make_libs:
cd ..;make
clean:
rm -f $(ALL_TESTS) *.o
rm -f $(ALL_TESTS) *.o *.gcno *.gcda *.gcov
rm -rf dir.*.tdb dir.*.bdb
test_db_curs4.tdb: trace.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