@ -9,9 +9,8 @@ INSTALL_PATH ?= $(CURDIR)
# Uncomment exactly one of the lines labelled (A), (B), and (C) below
# Uncomment exactly one of the lines labelled (A), (B), and (C) below
# to switch between compilation modes.
# to switch between compilation modes.
# OPT ?= -O2 -DNDEBUG # (A) Production use (optimized mode)
# OPT ?= -DNDEBUG # (A) Production use (optimized mode)
# OPT ?= -g2 # (B) Debug mode, w/ full line-level debugging symbols
OPT += -O3 -fno-omit-frame-pointer -momit-leaf-frame-pointer
OPT ?= -O2 -g2 -DNDEBUG -Wall # (C) Profiling mode: opt, but w/debugging symbols
#-----------------------------------------------
#-----------------------------------------------
# detect what platform we're building on
# detect what platform we're building on
@ -19,8 +18,9 @@ $(shell ./build_detect_platform build_config.mk)
# this file is generated by the previous line to set build flags and sources
# this file is generated by the previous line to set build flags and sources
i n c l u d e b u i l d _ c o n f i g . m k
i n c l u d e b u i l d _ c o n f i g . m k
CFLAGS += -Werror -I. -I./include $( PLATFORM_CCFLAGS) $( OPT)
WARNING_FLAGS = -Wall -Werror -Wno-unused-parameter -Wno-sign-compare
CXXFLAGS += -Werror -I. -I./include $( PLATFORM_CXXFLAGS) $( OPT)
CFLAGS += -g $( WARNING_FLAGS) -I. -I./include $( PLATFORM_CCFLAGS) $( OPT)
CXXFLAGS += -g $( WARNING_FLAGS) -I. -I./include $( PLATFORM_CXXFLAGS) $( OPT)
LDFLAGS += $( PLATFORM_LDFLAGS)
LDFLAGS += $( PLATFORM_LDFLAGS)
@ -65,7 +65,6 @@ TOOLS = \
PROGRAMS = db_bench $( TESTS) $( TOOLS)
PROGRAMS = db_bench $( TESTS) $( TOOLS)
BENCHMARKS = db_bench_sqlite3 db_bench_tree_db
BENCHMARKS = db_bench_sqlite3 db_bench_tree_db
VERSIONFILE = util/build_version.cc
LIBRARY = libleveldb.a
LIBRARY = libleveldb.a
MEMENVLIBRARY = libmemenv.a
MEMENVLIBRARY = libmemenv.a
@ -99,13 +98,17 @@ $(SHARED3):
e n d i f # PLATFORM_SHARED_EXT
e n d i f # PLATFORM_SHARED_EXT
all : $( VERSIONFILE ) $( SHARED ) $( LIBRARY ) $( TOOLS )
all : $( SHARED ) $( LIBRARY ) $( PROGRAMS )
release :
make clean
OPT = -DNDEBUG make -j32
check : all $( PROGRAMS ) $( TESTS ) $( TOOLS )
check : all $( PROGRAMS ) $( TESTS ) $( TOOLS )
for t in $( TESTS) ; do echo " ***** Running $$ t " ; ./$$ t || exit 1; done
for t in $( TESTS) ; do echo " ***** Running $$ t " ; ./$$ t || exit 1; done
clean :
clean :
-rm -f $( PROGRAMS) $( BENCHMARKS) $( LIBRARY) $( SHARED) $( MEMENVLIBRARY) $( THRIFTSERVER) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk $( VERSIONFILE) */*.d
-rm -f $( PROGRAMS) $( BENCHMARKS) $( LIBRARY) $( SHARED) $( MEMENVLIBRARY) $( THRIFTSERVER) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk
-rm -rf ios-x86/* ios-arm/*
-rm -rf ios-x86/* ios-arm/*
$(LIBRARY) : $( LIBOBJECTS )
$(LIBRARY) : $( LIBOBJECTS )