From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> Currently the libraries created have both the .so and the .so.X soft links pointing to the full verision .so.X.Y.Z. It's better to have them point serially instead of directly, as it is more common and also makes it easier to change the .so to point to a different .so.X if needed. Now the links will be: .so -> .so.X .so.X -> .so.X.Y.Z Also clean up the dependencies a little in the Makefile. Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- Makefile | 2 +- src/Makefile | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 035f4de..b4d0a72 100644 --- a/Makefile +++ b/Makefile @@ -293,7 +293,7 @@ $(LIBTRACEFS_STATIC): force $(bdir)/libtracefs.so.$(TRACEFS_VERSION): force $(Q)mkdir -p $(bdir) - $(Q)$(MAKE) -C $(src)/src $@ + $(Q)$(MAKE) -C $(src)/src libtracefs.so clean: $(MAKE) -C $(src)/utest clean diff --git a/src/Makefile b/src/Makefile index 1b06655..52f17af 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,13 +10,22 @@ OBJS += tracefs-events.o OBJS := $(OBJS:%.o=$(bdir)/%.o) DEPS := $(OBJS:$(bdir)/%.o=$(bdir)/.%.d) +LIBTRACEFS_SHARED_SO = $(bdir)/libtracefs.so +LIBTRACEFS_SHARED_VERSION = $(bdir)/libtracefs.so.$(TFS_VERSION) + $(LIBTRACEFS_STATIC): $(OBJS) $(Q)$(call do_build_static_lib) $(LIBTRACEFS_SHARED): $(OBJS) $(Q)$(call do_compile_shared_library) - @ln -sf $(@F) $(bdir)/libtracefs.so - @ln -sf $(@F) $(bdir)/libtracefs.so.$(TFS_VERSION) + +$(LIBTRACEFS_SHARED_VERSION): $(LIBTRACEFS_SHARED) + @ln -sf $(<F) $@ + +$(LIBTRACEFS_SHARED_SO): $(LIBTRACEFS_SHARED_VERSION) + @ln -sf $(<F) $@ + +libtracefs.so: $(LIBTRACEFS_SHARED_SO) $(bdir)/%.o: %.c $(Q)$(call do_fpic_compile) -- 2.25.4