Improve the build files to simplify the 3rd party release process

Summary:
* Added LIBNAME to enable configurable library name.
* remove/check fPIC in linux platform from build_detect_platform

Test Plan: make

Reviewers: emayanke

Differential Revision: https://reviews.facebook.net/D12321
main
Kai Liu 12 years ago
parent 387ac0f1e1
commit fd2f47dbe5
  1. 9
      Makefile
  2. 2
      build_tools/build_detect_platform

@ -75,7 +75,10 @@ TOOLS = \
PROGRAMS = db_bench signal_test $(TESTS) $(TOOLS) PROGRAMS = db_bench signal_test $(TESTS) $(TOOLS)
BENCHMARKS = db_bench_sqlite3 db_bench_tree_db BENCHMARKS = db_bench_sqlite3 db_bench_tree_db
LIBRARY = librocksdb.a # The library name is configurable since we are maintaining libraries of both
# debug/release mode.
LIBNAME = librocksdb
LIBRARY = ${LIBNAME}.a
MEMENVLIBRARY = libmemenv.a MEMENVLIBRARY = libmemenv.a
default: all default: all
@ -84,7 +87,7 @@ default: all
ifneq ($(PLATFORM_SHARED_EXT),) ifneq ($(PLATFORM_SHARED_EXT),)
ifneq ($(PLATFORM_SHARED_VERSIONED),true) ifneq ($(PLATFORM_SHARED_VERSIONED),true)
SHARED1 = librocksdb.$(PLATFORM_SHARED_EXT) SHARED1 = ${LIBNAME}.$(PLATFORM_SHARED_EXT)
SHARED2 = $(SHARED1) SHARED2 = $(SHARED1)
SHARED3 = $(SHARED1) SHARED3 = $(SHARED1)
SHARED = $(SHARED1) SHARED = $(SHARED1)
@ -92,7 +95,7 @@ else
# Update db.h if you change these. # Update db.h if you change these.
SHARED_MAJOR = 2 SHARED_MAJOR = 2
SHARED_MINOR = 0 SHARED_MINOR = 0
SHARED1 = librocksdb.$(PLATFORM_SHARED_EXT) SHARED1 = ${LIBNAME}.$(PLATFORM_SHARED_EXT)
SHARED2 = $(SHARED1).$(SHARED_MAJOR) SHARED2 = $(SHARED1).$(SHARED_MAJOR)
SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR) SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR)
SHARED = $(SHARED1) $(SHARED2) $(SHARED3) SHARED = $(SHARED1) $(SHARED2) $(SHARED3)

@ -78,7 +78,7 @@ case "$TARGET_OS" in
;; ;;
Linux) Linux)
PLATFORM=OS_LINUX PLATFORM=OS_LINUX
COMMON_FLAGS="$COMMON_FLAGS -DOS_LINUX -fPIC" COMMON_FLAGS="$COMMON_FLAGS -DOS_LINUX"
if [ -z "$USE_CLANG" ]; then if [ -z "$USE_CLANG" ]; then
COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp" COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp"
fi fi

Loading…
Cancel
Save