@ -2,9 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. See the AUTHORS file for names of contributors.
# found in the LICENSE file. See the AUTHORS file for names of contributors.
# Inherit some settings from environment variables, if available
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.
@ -24,6 +21,7 @@ CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
CXXFLAGS += -I. -I./include $( PLATFORM_CXXFLAGS) $( OPT)
CXXFLAGS += -I. -I./include $( PLATFORM_CXXFLAGS) $( OPT)
LDFLAGS += $( PLATFORM_LDFLAGS)
LDFLAGS += $( PLATFORM_LDFLAGS)
LIBS += $( PLATFORM_LIBS)
LIBOBJECTS = $( SOURCES:.cc= .o)
LIBOBJECTS = $( SOURCES:.cc= .o)
MEMENVOBJECTS = $( MEMENV_SOURCES:.cc= .o)
MEMENVOBJECTS = $( MEMENV_SOURCES:.cc= .o)
@ -71,7 +69,7 @@ SHARED = $(SHARED1)
e l s e
e l s e
# Update db.h if you change these.
# Update db.h if you change these.
SHARED_MAJOR = 1
SHARED_MAJOR = 1
SHARED_MINOR = 6
SHARED_MINOR = 7
SHARED1 = libleveldb.$( PLATFORM_SHARED_EXT)
SHARED1 = libleveldb.$( PLATFORM_SHARED_EXT)
SHARED2 = $( SHARED1) .$( SHARED_MAJOR)
SHARED2 = $( SHARED1) .$( SHARED_MAJOR)
SHARED3 = $( SHARED1) .$( SHARED_MAJOR) .$( SHARED_MINOR)
SHARED3 = $( SHARED1) .$( SHARED_MAJOR) .$( SHARED_MINOR)
@ -83,7 +81,7 @@ $(SHARED2): $(SHARED3)
e n d i f
e n d i f
$(SHARED3) :
$(SHARED3) :
$( CXX) $( SOURCES) $( LDFLAGS) $( PLATFORM_SHARED_LDFLAGS) $( INSTALL_PATH) $( SHARED2) $( CXXFLAGS) $( PLATFORM_SHARED_CFLAGS) -o $( SHARED3 )
$( CXX) $( LDFLAGS) $( PLATFORM_SHARED_LDFLAGS) $( SHARED2) $( CXXFLAGS) $( PLATFORM_SHARED_CFLAGS) $( SOURCES) -o $( SHARED3) $( LIBS )
e n d i f # PLATFORM_SHARED_EXT
e n d i f # PLATFORM_SHARED_EXT
@ -101,74 +99,74 @@ $(LIBRARY): $(LIBOBJECTS)
$( AR) -rs $@ $( LIBOBJECTS)
$( AR) -rs $@ $( LIBOBJECTS)
db_bench : db /db_bench .o $( LIBOBJECTS ) $( TESTUTIL )
db_bench : db /db_bench .o $( LIBOBJECTS ) $( TESTUTIL )
$( CXX) db/db_bench.o $( LIBOBJECTS) $( TESTUTIL) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/db_bench.o $( LIBOBJECTS) $( TESTUTIL) -o $@ $( LIB S)
db_bench_sqlite3 : doc /bench /db_bench_sqlite 3.o $( LIBOBJECTS ) $( TESTUTIL )
db_bench_sqlite3 : doc /bench /db_bench_sqlite 3.o $( LIBOBJECTS ) $( TESTUTIL )
$( CXX) doc/bench/db_bench_sqlite3.o $( LIBOBJECTS) $( TESTUTIL) -o $@ $( LDFLAGS) -lsqlite3
$( CXX) $( LDFLAGS) doc/bench/db_bench_sqlite3.o $( LIBOBJECTS) $( TESTUTIL) -o $@ -lsqlite3 $( LIBS)
db_bench_tree_db : doc /bench /db_bench_tree_db .o $( LIBOBJECTS ) $( TESTUTIL )
db_bench_tree_db : doc /bench /db_bench_tree_db .o $( LIBOBJECTS ) $( TESTUTIL )
$( CXX) doc/bench/db_bench_tree_db.o $( LIBOBJECTS) $( TESTUTIL) -o $@ $( LDFLAGS) -lkyotocabinet
$( CXX) $( LDFLAGS) doc/bench/db_bench_tree_db.o $( LIBOBJECTS) $( TESTUTIL) -o $@ -lkyotocabinet $( LIBS)
arena_test : util /arena_test .o $( LIBOBJECTS ) $( TESTHARNESS )
arena_test : util /arena_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) util/arena_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) util/arena_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
bloom_test : util /bloom_test .o $( LIBOBJECTS ) $( TESTHARNESS )
bloom_test : util /bloom_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) util/bloom_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) util/bloom_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
c_test : db /c_test .o $( LIBOBJECTS ) $( TESTHARNESS )
c_test : db /c_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/c_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/c_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
cache_test : util /cache_test .o $( LIBOBJECTS ) $( TESTHARNESS )
cache_test : util /cache_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) util/cache_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) util/cache_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
coding_test : util /coding_test .o $( LIBOBJECTS ) $( TESTHARNESS )
coding_test : util /coding_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) util/coding_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) util/coding_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
corruption_test : db /corruption_test .o $( LIBOBJECTS ) $( TESTHARNESS )
corruption_test : db /corruption_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/corruption_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/corruption_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
crc32c_test : util /crc 32c_test .o $( LIBOBJECTS ) $( TESTHARNESS )
crc32c_test : util /crc 32c_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) util/crc32c_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) util/crc32c_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
db_test : db /db_test .o $( LIBOBJECTS ) $( TESTHARNESS )
db_test : db /db_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/db_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/db_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
dbformat_test : db /dbformat_test .o $( LIBOBJECTS ) $( TESTHARNESS )
dbformat_test : db /dbformat_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/dbformat_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/dbformat_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
env_test : util /env_test .o $( LIBOBJECTS ) $( TESTHARNESS )
env_test : util /env_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) util/env_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) util/env_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
filename_test : db /filename_test .o $( LIBOBJECTS ) $( TESTHARNESS )
filename_test : db /filename_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/filename_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/filename_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
filter_block_test : table /filter_block_test .o $( LIBOBJECTS ) $( TESTHARNESS )
filter_block_test : table /filter_block_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) table/filter_block_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) table/filter_block_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
log_test : db /log_test .o $( LIBOBJECTS ) $( TESTHARNESS )
log_test : db /log_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/log_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/log_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
table_test : table /table_test .o $( LIBOBJECTS ) $( TESTHARNESS )
table_test : table /table_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) table/table_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) table/table_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
skiplist_test : db /skiplist_test .o $( LIBOBJECTS ) $( TESTHARNESS )
skiplist_test : db /skiplist_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/skiplist_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/skiplist_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
version_edit_test : db /version_edit_test .o $( LIBOBJECTS ) $( TESTHARNESS )
version_edit_test : db /version_edit_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/version_edit_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/version_edit_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
version_set_test : db /version_set_test .o $( LIBOBJECTS ) $( TESTHARNESS )
version_set_test : db /version_set_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/version_set_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/version_set_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
write_batch_test : db /write_batch_test .o $( LIBOBJECTS ) $( TESTHARNESS )
write_batch_test : db /write_batch_test .o $( LIBOBJECTS ) $( TESTHARNESS )
$( CXX) db/write_batch_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) db/write_batch_test.o $( LIBOBJECTS) $( TESTHARNESS) -o $@ $( LIB S)
$(MEMENVLIBRARY) : $( MEMENVOBJECTS )
$(MEMENVLIBRARY) : $( MEMENVOBJECTS )
rm -f $@
rm -f $@
$( AR) -rs $@ $( MEMENVOBJECTS)
$( AR) -rs $@ $( MEMENVOBJECTS)
memenv_test : helpers /memenv /memenv_test .o $( MEMENVLIBRARY ) $( LIBRARY ) $( TESTHARNESS )
memenv_test : helpers /memenv /memenv_test .o $( MEMENVLIBRARY ) $( LIBRARY ) $( TESTHARNESS )
$( CXX) helpers/memenv/memenv_test.o $( MEMENVLIBRARY) $( LIBRARY) $( TESTHARNESS) -o $@ $( LDFLAG S)
$( CXX) $( LDFLAGS) helpers/memenv/memenv_test.o $( MEMENVLIBRARY) $( LIBRARY) $( TESTHARNESS) -o $@ $( LIB S)
i f e q ( $( PLATFORM ) , I O S )
i f e q ( $( PLATFORM ) , I O S )
# For iOS, create universal object files to be used on both the simulator and
# For iOS, create universal object files to be used on both the simulator and