linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libtracefs: Fix soft links to have a proper order
@ 2020-12-11 15:30 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2020-12-11 15:30 UTC (permalink / raw)
  To: Linux Trace Devel

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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@goodmis.org>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-11 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 15:30 [PATCH] libtracefs: Fix soft links to have a proper order Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).