aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuan Zhao2019-12-12 17:14:37 -0600
committerYuan Zhao2019-12-12 17:51:49 -0600
commit8bf9d8bcde4199e0090d5805b9c065c46af83ad5 (patch)
tree6b14e44b1e2af8c7a26cadf97a4df5f726c34df3
parentc93bb43c1144096def3d99f205da6950162af566 (diff)
downloadtidl-api-8bf9d8bcde4199e0090d5805b9c065c46af83ad5.tar.gz
tidl-api-8bf9d8bcde4199e0090d5805b9c065c46af83ad5.tar.xz
tidl-api-8bf9d8bcde4199e0090d5805b9c065c46af83ad5.zip
Fix versioning for shared libary
- by putting proper SONAME in built shared libraries. - MCT-1231
-rw-r--r--tidl_api/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/tidl_api/Makefile b/tidl_api/Makefile
index a04e604..3a5ea69 100644
--- a/tidl_api/Makefile
+++ b/tidl_api/Makefile
@@ -37,6 +37,8 @@ all: $(LIB_NAME) $(LIB_IMGUTIL_NAME) $(PY_LIB_NAME) \
37include make.inc 37include make.inc
38include make.buildid 38include make.buildid
39 39
40SO_VER=$(MAJOR_VER).$(MINOR_VER).$(PATCH_VER)
41
40RM = rm 42RM = rm
41AR = ar 43AR = ar
42 44
@@ -95,7 +97,10 @@ $(LIB_NAME): $(HOST_OBJ_FILES)
95 $(AR) cr $@ $(HOST_OBJ_FILES) 97 $(AR) cr $@ $(HOST_OBJ_FILES)
96 98
97$(SHARED_LIB_NAME): $(HOST_OBJ_FILES) 99$(SHARED_LIB_NAME): $(HOST_OBJ_FILES)
98 $(CXX) $(CXXFLAGS) -Wl,-Bsymbolic -shared -lOpenCL $(HOST_OBJ_FILES) -o $@ 100 $(CXX) $(CXXFLAGS) -Wl,-Bsymbolic -shared -Wl,-soname,$@.$(MAJOR_VER) \
101 -lOpenCL $(HOST_OBJ_FILES) -o $@.$(SO_VER)
102 ln -sf $@.$(SO_VER) $@.$(MAJOR_VER)
103 ln -sf $@.$(MAJOR_VER) $@
99 104
100$(PY_LIB_NAME): $(HOST_OBJ_PYBIND_FILES) $(LIB_NAME) 105$(PY_LIB_NAME): $(HOST_OBJ_PYBIND_FILES) $(LIB_NAME)
101 $(CXX) $(CXXFLAGS) -Wl,-Bsymbolic -shared -lOpenCL -locl_util $^ -o $@ 106 $(CXX) $(CXXFLAGS) -Wl,-Bsymbolic -shared -lOpenCL -locl_util $^ -o $@
@@ -104,10 +109,14 @@ $(LIB_IMGUTIL_NAME): $(HOST_OBJ_IMGUTIL_FILES)
104 $(AR) cr $@ $(HOST_OBJ_IMGUTIL_FILES) 109 $(AR) cr $@ $(HOST_OBJ_IMGUTIL_FILES)
105 110
106$(SHARED_LIB_IMGUTIL_NAME): $(HOST_OBJ_IMGUTIL_FILES) 111$(SHARED_LIB_IMGUTIL_NAME): $(HOST_OBJ_IMGUTIL_FILES)
107 $(CXX) $(CXXFLAGS) -Wl,-Bsymbolic -shared $(HOST_OBJ_IMGUTIL_FILES) -o $@ 112 $(CXX) $(CXXFLAGS) -Wl,-Bsymbolic -shared -Wl,-soname,$@.$(MAJOR_VER) \
113 $(HOST_OBJ_IMGUTIL_FILES) -o $@.$(SO_VER)
114 ln -sf $@.$(SO_VER) $@.$(MAJOR_VER)
115 ln -sf $@.$(MAJOR_VER) $@
108 116
109clean:: 117clean::
110 $(RM) -f $(LIB_NAME) $(PY_LIB_NAME) 118 $(RM) -f $(LIB_NAME) $(PY_LIB_NAME)
111 $(RM) -f $(LIB_IMGUTIL_NAME) 119 $(RM) -f $(LIB_IMGUTIL_NAME)
120 $(RM) -f $(SHARED_LIB_NAME)* $(SHARED_LIB_IMGUTIL_NAME)*
112 $(RM) -rf obj 121 $(RM) -rf obj
113 122