diff --git a/Makefile b/Makefile index a402ad28980..457e1297a0d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ TAGS: */*.c */*.h etags */*.c */*.h +SRCDIRS = newbrt src src/tests cxx cxx/tests utils db-benchmark-test db-benchmark-test-cxx + clean: - cd newbrt;make clean - cd src;make clean - cd db-benchmark-test-cxx;make clean + for d in $(SRCDIRS); do $(MAKE) -k -C $$d clean; done + +build: + for d in $(SRCDIRS); do $(MAKE) -k -C $$d; done + +build-coverage: + for d in $(SRCDIRS); do $(MAKE) -k -C $$d -k OPTFLAGS="-O0" GCOV_FLAGS="-fprofile-arcs -ftest-coverage"; done diff --git a/db-benchmark-test-cxx/Makefile b/db-benchmark-test-cxx/Makefile index 06604824e0b..8be751df2a2 100644 --- a/db-benchmark-test-cxx/Makefile +++ b/db-benchmark-test-cxx/Makefile @@ -7,9 +7,8 @@ BENCHDBS = bench.bdb/ bench.tokudb OPTFLAGS = -O2 -CXXFLAGS = -Wall -Werror -g +CXXFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS) # CFLAGS += -pg -CXXFLAGS += $(OPTFLAGS) ifdef BDBDIR BDB_CPPFLAGS = -I$(BDBDIR)/include @@ -24,7 +23,7 @@ TARGETS = db-benchmark-test-bdb db-benchmark-test-tokudb default: $(TARGETS) clean: - rm -rf $(TARGETS) $(BENCHDBS) + rm -rf $(TARGETS) $(BENCHDBS) *.gcno *.gcda *.gcov db-benchmark-test-tokudb: ../lib/libtdb_cxx.a db-benchmark-test-tokudb: db-benchmark-test.cpp diff --git a/db-benchmark-test/Makefile b/db-benchmark-test/Makefile index ddcc6683db7..19a34b1407c 100644 --- a/db-benchmark-test/Makefile +++ b/db-benchmark-test/Makefile @@ -8,9 +8,8 @@ BENCHDBS = bench.bdb/ bench.tokudb OPTFLAGS = -O2 -CFLAGS = -Wall -Werror -g +CFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS) # CFLAGS += -pg -CFLAGS += $(OPTFLAGS) ifdef BDBDIR BDB_CPPFLAGS = -I$(BDBDIR)/include @@ -25,7 +24,7 @@ TARGETS = db-benchmark-test-bdb db-benchmark-test-tokudb default: $(TARGETS) clean: - rm -rf $(TARGETS) $(BENCHDBS) + rm -rf $(TARGETS) $(BENCHDBS) *.gcno *.gcda *.gcov db-benchmark-test-tokudb: db-benchmark-test.c $(CC) $(CFLAGS) -I../include -L../lib -ldb -Wl,-rpath,$(PWD)/../lib $< -o $@ -DDIRSUF=tokudb diff --git a/utils/Makefile b/utils/Makefile index 495425d763c..0129a77cfd7 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -6,7 +6,7 @@ BDB_LOAD=$(BDBDIR)/bin/db_load DIFF=diff -I 'db_pagesize=' -CFLAGS = -std=gnu89 -W -Wall -Wno-unused -g +CFLAGS = -std=gnu89 -W -Wall -Wno-unused -g $(OPTFLAGS) $(GCOV_FLAGS) # vars to compile bins that handle tokudb using libdb.so # when one uses relative address in an rpath, the library better be located relative