Commit 1bad2b1f authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

add build variables to control DEBUG and GCOV builds. addresses #317

git-svn-id: file:///svn/mysql/tokudb-engine/src@3021 c7de825b-a66e-492c-adef-691d508d4ae1
parent 13b679ae
...@@ -2,20 +2,25 @@ ...@@ -2,20 +2,25 @@
MYSQL_SRC = $(HOME)/mysql-5.1.23-rc MYSQL_SRC = $(HOME)/mysql-5.1.23-rc
MYSQL_LIBDIR = $(HOME)/mysql-5.1.23-rc-build/lib/mysql MYSQL_LIBDIR = $(HOME)/mysql-5.1.23-rc-build/lib/mysql
TOKUDB = /usr/local/tokudb-4.4 TOKUDB = /usr/local/tokudb-4.4
DEBUG = 1
# sources to target # sources to target
SRCS = $(wildcard *.cc) SRCS = $(wildcard *.cc)
OBJS = $(patsubst %.cc,%.o,$(SRCS)) OBJS = $(patsubst %.cc,%.o,$(SRCS))
TARGET = $(patsubst %.o,%.so,$(OBJS)) TARGET = $(patsubst %.o,%.so,$(OBJS))
# someday turn up the optimization ifeq ($(GCOV),1)
OPTFLAGS = -O0 GCOV_FLAGS = -ftest-coverage -fprofile-arcs
# GCOV_FLAGS = -ftest-coverage -fprofile-arcs endif
# MYSQL_FLAGS =
# debug flags ifeq ($(DEBUG),0)
OPTFLAGS = -O2
MYSQL_FLAGS =
else
OPTFLAGS = -O0
MYSQL_FLAGS = -DHAVE_CONFIG_H -DDBUG_ON -DSAFE_MUTEX -DEXTRA_DEBUG -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX MYSQL_FLAGS = -DHAVE_CONFIG_H -DDBUG_ON -DSAFE_MUTEX -DEXTRA_DEBUG -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX
endif
MYSQL_FLAGS += -DMYSQL_DYNAMIC_PLUGIN MYSQL_FLAGS += -DMYSQL_DYNAMIC_PLUGIN
MYSQL_CXXFLAGS = -fno-implicit-templates -fno-exceptions -fno-rtti MYSQL_CXXFLAGS = -fno-implicit-templates -fno-exceptions -fno-rtti
...@@ -23,7 +28,7 @@ CPPFLAGS = -I. -I$(MYSQL_SRC)/sql -I$(MYSQL_SRC)/include -I$(MYSQL_SRC)/regex -I ...@@ -23,7 +28,7 @@ CPPFLAGS = -I. -I$(MYSQL_SRC)/sql -I$(MYSQL_SRC)/include -I$(MYSQL_SRC)/regex -I
CPPFLAGS += $(MYSQL_FLAGS) CPPFLAGS += $(MYSQL_FLAGS)
CXXFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS) CXXFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS)
CXXFLAGS += -fPIC CXXFLAGS += -fPIC
LDFLAGS = -shared -Wl,-soname -Wl,libtokudb_engine.so LDFLAGS = -fPIC -shared -Wl,-soname -Wl,libtokudb_engine.so
LIBS = -L$(TOKUDB)/lib -ltokudb -lpthread -lz -lstdc++ -lm -lgcc_s -lc LIBS = -L$(TOKUDB)/lib -ltokudb -lpthread -lz -lstdc++ -lm -lgcc_s -lc
# LIBDIR = /usr/lib # LIBDIR = /usr/lib
...@@ -37,7 +42,7 @@ all: $(TARGET) ...@@ -37,7 +42,7 @@ all: $(TARGET)
$(CXX) $(LDFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS) $(BEGINLIBS) $< $(LIBS) $(ENDLIBS) -o $@ $(CXX) $(LDFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS) $(BEGINLIBS) $< $(LIBS) $(ENDLIBS) -o $@
clean: clean:
rm -rf $(TARGET) $(OBJS) rm -rf $(TARGET) $(OBJS) *.gcno *.gcda *.gcov
install: $(TARGET) install: $(TARGET)
cp $(TARGET) $(MYSQL_LIBDIR)/libtokudb_engine.so cp $(TARGET) $(MYSQL_LIBDIR)/libtokudb_engine.so
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