@ -23,6 +23,14 @@ $(shell (export ROCKSDB_ROOT=$(CURDIR); $(CURDIR)/build_tools/build_detect_platf
# 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 f n e q ( $( PLATFORM ) , I O S )
CFLAGS += -g
CXXFLAGS += -g
e l s e
# no debug info for IOS, that will make our library big
OPT += -DNDEBUG
e n d i f
# ASAN doesn't work well with jemalloc. If we're compiling with ASAN, we should use regular malloc.
i f d e f C O M P I L E _ W I T H _ A S A N
# ASAN compile flags
@ -36,9 +44,9 @@ else
PLATFORM_CCFLAGS += $( JEMALLOC_INCLUDE) -DHAVE_JEMALLOC
e n d i f
WARNING_FLAGS = -Wall -Werror -Wno-sign-compare
CFLAGS += -g $( WARNING_FLAGS) -I. -I./include $( PLATFORM_CCFLAGS) $( OPT)
CXXFLAGS += -g $( WARNING_FLAGS) -I. -I./include $( PLATFORM_CXXFLAGS) $( OPT) -Woverloaded-virtual
WARNING_FLAGS = -Wall -Werror -Wno-sign-compare -Wno-unused-const-variable
CFLAGS += $( WARNING_FLAGS) -I. -I./include $( PLATFORM_CCFLAGS) $( OPT)
CXXFLAGS += $( WARNING_FLAGS) -I. -I./include $( PLATFORM_CXXFLAGS) $( OPT) -Woverloaded-virtual
LDFLAGS += $( PLATFORM_LDFLAGS)
@ -148,11 +156,15 @@ $(SHARED3):
e n d i f # PLATFORM_SHARED_EXT
.PHONY : blackbox_crash_test check clean coverage crash_test ldb_tests \
release tags valgrind_check whitebox_crash_test format shared_lib all \
release tags valgrind_check whitebox_crash_test format static_lib s hared_lib all \
dbg
all : $( LIBRARY ) $( PROGRAMS )
static_lib : $( LIBRARY )
shared_lib : $( SHARED )
dbg : $( LIBRARY ) $( PROGRAMS )
# Will also generate shared libraries.
@ -218,8 +230,6 @@ tags:
format :
build_tools/format-diff.sh
shared_lib : $( SHARED )
# ---------------------------------------------------------------------------
# Unit tests and tools
# ---------------------------------------------------------------------------
@ -439,16 +449,16 @@ IOSVERSION=$(shell defaults read $(PLATFORMSROOT)/iPhoneOS.platform/versionCFBun
.cc.o :
mkdir -p ios-x86/$( dir $@ )
$( SIMULATORROOT) /usr/bin/$( CXX) $( CXXFLAGS) -isysroot $( SIMULATORROOT) /SDKs/iPhoneSimulator$( IOSVERSION) .sdk -arch i686 -c $< -o ios-x86/$@ $( COVERAGEFLAGS)
$( CXX) $( CXXFLAGS) -isysroot $( SIMULATORROOT) /SDKs/iPhoneSimulator$( IOSVERSION) .sdk -arch i686 -arch x86_64 - c $< -o ios-x86/$@
mkdir -p ios-arm/$( dir $@ )
$( DEVICEROOT) /usr/bin/$( CXX) $( CXXFLAGS) -isysroot $( DEVICEROOT) /SDKs/iPhoneOS$( IOSVERSION) .sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@ $( COVERAGEFLAGS)
xcrun -sdk iphoneos $( CXX) $( CXXFLAGS) -isysroot $( DEVICEROOT) /SDKs/iPhoneOS$( IOSVERSION) .sdk -arch armv6 -arch armv7 -arch armv7s -arch arm64 - c $< -o ios-arm/$@
lipo ios-x86/$@ ios-arm/$@ -create -output $@
.c.o :
mkdir -p ios-x86/$( dir $@ )
$( SIMULATORROOT) /usr/bin/$( CC) $( CFLAGS) -isysroot $( SIMULATORROOT) /SDKs/iPhoneSimulator$( IOSVERSION) .sdk -arch i686 -c $< -o ios-x86/$@
$( CC) $( CFLAGS) -isysroot $( SIMULATORROOT) /SDKs/iPhoneSimulator$( IOSVERSION) .sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@
mkdir -p ios-arm/$( dir $@ )
$( DEVICEROOT) /usr/bin/$( CC) $( CFLAGS) -isysroot $( DEVICEROOT) /SDKs/iPhoneOS$( IOSVERSION) .sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@
xcrun -sdk iphoneos $( CC) $( CFLAGS) -isysroot $( DEVICEROOT) /SDKs/iPhoneOS$( IOSVERSION) .sdk -arch armv6 -arch armv7 -arch armv7s -arch arm64 -c $< -o ios-arm/$@
lipo ios-x86/$@ ios-arm/$@ -create -output $@
e l s e