aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Hofmann2018-10-21 11:42:19 -0500
committerJérôme Forissier2018-11-21 09:20:21 -0600
commit28eea17f4dba5bbf7848926eb031ba660e8856f0 (patch)
treeecd68bd502498f064176ebd61d60198b7c2fbbe4
parent656e4276589fd1e4924d8155b285d19d831f7742 (diff)
downloadti-optee-client-28eea17f4dba5bbf7848926eb031ba660e8856f0.tar.gz
ti-optee-client-28eea17f4dba5bbf7848926eb031ba660e8856f0.tar.xz
ti-optee-client-28eea17f4dba5bbf7848926eb031ba660e8856f0.zip
libteec: Makefile: Generate .so files the same way as CMake
Update the Makefile so that the generated libteec.so file and the corresponding symlinks match those generated by the CMake script. Specifically, before this commit the Makefile generated the following files: symlink: libteec.so -> libteec.so.1 symlink: libteec.so.1 -> libteec.so.1.0 file: libteec.so.1.0 (SONAME libteec.so.1.0) With this commit the generated files are: symlink: libteec.so -> libteec.so.1 symlink: libteec.so.1 -> libteec.so.1.0.0 symlink: libteec.so.1.0 -> libteec.so.1.0.0 file: libteec.so.1.0.0 (SONAME libteec.so.1) The symlink "libteec.so.1.0" is kept for compatibility with existing installations. Note that "libteec.so.1.0" is not generated by the CMake script. Signed-off-by: Fabian Hofmann <fabian.hofmann@fau.de> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
-rw-r--r--libteec/Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/libteec/Makefile b/libteec/Makefile
index e5cbfa30..9f475b89 100644
--- a/libteec/Makefile
+++ b/libteec/Makefile
@@ -11,9 +11,11 @@ all: libteec
11################################################################################ 11################################################################################
12MAJOR_VERSION := 1 12MAJOR_VERSION := 1
13MINOR_VERSION := 0 13MINOR_VERSION := 0
14PATCH_VERSION := 0
14LIB_NAME := libteec.so 15LIB_NAME := libteec.so
15LIB_MAJOR := $(LIB_NAME).$(MAJOR_VERSION) 16LIB_MAJOR := $(LIB_NAME).$(MAJOR_VERSION)
16LIB_MAJ_MIN := $(LIB_NAME).$(MAJOR_VERSION).$(MINOR_VERSION) 17LIB_MAJ_MIN := $(LIB_NAME).$(MAJOR_VERSION).$(MINOR_VERSION)
18LIB_MAJ_MIN_P := $(LIB_NAME).$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
17 19
18TEEC_SRCS := tee_client_api.c \ 20TEEC_SRCS := tee_client_api.c \
19 teec_trace.c 21 teec_trace.c
@@ -37,15 +39,16 @@ TEEC_CFLAGS += -DCFG_TEE_BENCHMARK
37endif 39endif
38 40
39TEEC_LFLAGS := $(LDFLAGS) -lpthread 41TEEC_LFLAGS := $(LDFLAGS) -lpthread
40TEEC_LIBRARY := $(OUT_DIR)/$(LIB_MAJ_MIN) 42TEEC_LIBRARY := $(OUT_DIR)/$(LIB_MAJ_MIN_P)
41 43
42libteec: $(TEEC_LIBRARY) $(OUT_DIR)/libteec.a 44libteec: $(TEEC_LIBRARY) $(OUT_DIR)/libteec.a
43 $(VPREFIX)ln -sf $(LIB_MAJ_MIN) $(OUT_DIR)/$(LIB_MAJOR) 45 $(VPREFIX)ln -sf $(LIB_MAJ_MIN_P) $(OUT_DIR)/$(LIB_MAJOR)
46 $(VPREFIX)ln -sf $(LIB_MAJ_MIN_P) $(OUT_DIR)/$(LIB_MAJ_MIN)
44 $(VPREFIX)ln -sf $(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME) 47 $(VPREFIX)ln -sf $(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME)
45 48
46$(TEEC_LIBRARY): $(TEEC_OBJS) 49$(TEEC_LIBRARY): $(TEEC_OBJS)
47 @echo " LINK $@" 50 @echo " LINK $@"
48 $(VPREFIX)$(CC) -shared -Wl,-soname,$(LIB_MAJ_MIN) $(TEEC_LFLAGS) -o $@ $+ 51 $(VPREFIX)$(CC) -shared -Wl,-soname,$(LIB_MAJOR) $(TEEC_LFLAGS) -o $@ $+
49 @echo "" 52 @echo ""
50 53
51$(OUT_DIR)/libteec.a: $(TEEC_OBJS) 54$(OUT_DIR)/libteec.a: $(TEEC_OBJS)
@@ -61,6 +64,7 @@ $(TEEC_OBJ_DIR)/%.o: ${TEEC_SRC_DIR}/%.c
61# Cleaning up configuration 64# Cleaning up configuration
62################################################################################ 65################################################################################
63clean: 66clean:
64 $(RM) $(TEEC_OBJS) $(TEEC_LIBRARY) $(OUT_DIR)/$(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME) 67 $(RM) $(TEEC_OBJS) $(TEEC_LIBRARY) $(OUT_DIR)/$(LIB_MAJOR) \
68 $(OUT_DIR)/$(LIB_MAJ_MIN) $(OUT_DIR)/$(LIB_NAME)
65 $(RM) $(OUT_DIR)/libteec.a 69 $(RM) $(OUT_DIR)/libteec.a
66 $(call rmdir,$(OUT_DIR)) 70 $(call rmdir,$(OUT_DIR))