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 @@
MYSQL_SRC = $(HOME)/mysql-5.1.23-rc
MYSQL_LIBDIR = $(HOME)/mysql-5.1.23-rc-build/lib/mysql
TOKUDB = /usr/local/tokudb-4.4
DEBUG = 1
# sources to target
SRCS = $(wildcard *.cc)
OBJS = $(patsubst %.cc,%.o,$(SRCS))
TARGET = $(patsubst %.o,%.so,$(OBJS))
# someday turn up the optimization
OPTFLAGS = -O0
# GCOV_FLAGS = -ftest-coverage -fprofile-arcs
# MYSQL_FLAGS =
ifeq ($(GCOV),1)
GCOV_FLAGS = -ftest-coverage -fprofile-arcs
endif
# 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
endif
MYSQL_FLAGS += -DMYSQL_DYNAMIC_PLUGIN
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
CPPFLAGS += $(MYSQL_FLAGS)
CXXFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS)
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
# LIBDIR = /usr/lib
......@@ -37,7 +42,7 @@ all: $(TARGET)
$(CXX) $(LDFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS) $(BEGINLIBS) $< $(LIBS) $(ENDLIBS) -o $@
clean:
rm -rf $(TARGET) $(OBJS)
rm -rf $(TARGET) $(OBJS) *.gcno *.gcda *.gcov
install: $(TARGET)
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