提交 ed8fefc9 编写于 作者: M Max Bruckner

Makefile: Fix #252, put soname in the ELF file

上级 e6869c2e
...@@ -12,6 +12,9 @@ LIBVERSION = 1.7.5 ...@@ -12,6 +12,9 @@ LIBVERSION = 1.7.5
CJSON_SOVERSION = 1 CJSON_SOVERSION = 1
UTILS_SOVERSION = 1 UTILS_SOVERSION = 1
CJSON_SO_LDFLAG=-Wl,-soname=$(CJSON_LIBNAME).so.$(CJSON_SOVERSION)
UTILS_SO_LDFLAG=-Wl,-soname=$(UTILS_LIBNAME).so.$(UTILS_SOVERSION)
PREFIX ?= /usr/local PREFIX ?= /usr/local
INCLUDE_PATH ?= include/cjson INCLUDE_PATH ?= include/cjson
LIBRARY_PATH ?= lib LIBRARY_PATH ?= lib
...@@ -42,6 +45,8 @@ STATIC = a ...@@ -42,6 +45,8 @@ STATIC = a
## create dynamic (shared) library on Darwin (base OS for MacOSX and IOS) ## create dynamic (shared) library on Darwin (base OS for MacOSX and IOS)
ifeq (Darwin, $(uname)) ifeq (Darwin, $(uname))
SHARED = dylib SHARED = dylib
CJSON_SO_LDFLAG = ""
UTILS_SO_LDFLAG = ""
endif endif
#cJSON library names #cJSON library names
...@@ -90,10 +95,10 @@ $(UTILS_STATIC): $(UTILS_OBJ) ...@@ -90,10 +95,10 @@ $(UTILS_STATIC): $(UTILS_OBJ)
#shared libraries .so.1.0.0 #shared libraries .so.1.0.0
#cJSON #cJSON
$(CJSON_SHARED_VERSION): $(CJSON_OBJ) $(CJSON_SHARED_VERSION): $(CJSON_OBJ)
$(CC) -shared -o $@ $< $(LDFLAGS) $(CC) -shared -o $@ $< $(CJSON_SO_LDFLAG) $(LDFLAGS)
#cJSON_Utils #cJSON_Utils
$(UTILS_SHARED_VERSION): $(UTILS_OBJ) $(UTILS_SHARED_VERSION): $(UTILS_OBJ)
$(CC) -shared -o $@ $< $(LDFLAGS) $(CC) -shared -o $@ $< $(UTILS_SO_LDFLAG) $(LDFLAGS)
#objects #objects
#cJSON #cJSON
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册