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