linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 3/3] libtracefs: Do not install library in a subfolder
Date: Thu, 26 Nov 2020 09:27:19 +0200	[thread overview]
Message-ID: <20201126072719.906443-4-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20201126072719.906443-1-tz.stoyanov@gmail.com>

From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>

Make the installation consistent with libtraceevent:
 - Install tracefs.h in $(prefix)/include/tracefs/
 - Install libtracefs* in $(prefix)/lib or $(prefix)/lib64

Signed-off-by: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
---
 Makefile | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index b464401..3158698 100644
--- a/Makefile
+++ b/Makefile
@@ -38,14 +38,22 @@ INSTALL = install
 DESTDIR ?=
 DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
 
+LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
+ifeq ($(LP64), 1)
+  libdir_relative_temp = lib64
+else
+  libdir_relative_temp = lib
+endif
+
+libdir_relative ?= $(libdir_relative_temp)
 prefix ?= /usr/local
 bindir_relative = bin
 bindir = $(prefix)/$(bindir_relative)
 man_dir = $(prefix)/share/man
 man_dir_SQ = '$(subst ','\'',$(man_dir))'
-libdir ?= $(prefix)/lib
+libdir = $(prefix)/$(libdir_relative)
 libdir_SQ = '$(subst ','\'',$(libdir))'
-includedir = $(prefix)/include
+includedir = $(prefix)/include/tracefs
 includedir_SQ = '$(subst ','\'',$(includedir))'
 pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) 		\
 			--variable pc_path pkg-config | tr ":" " "))
@@ -212,10 +220,10 @@ cscope: force
 	$(call find_tag_files) | cscope -b -q
 
 install_libs: libs install_pkgconfig
-	$(Q)$(call do_install,$(LIBTRACEFS_SHARED),$(libdir_SQ)/tracefs); \
-		cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)/tracefs
-	$(Q)$(call do_install,$(src)/include/tracefs.h,$(includedir_SQ)/tracefs)
-	$(Q)$(call do_install_ld,$(TRACE_LD_FILE),$(LD_SO_CONF_DIR),$(libdir_SQ)/tracefs)
+	$(Q)$(call do_install,$(LIBTRACEFS_SHARED),$(libdir_SQ)); \
+		cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
+	$(Q)$(call do_install,$(src)/include/tracefs.h,$(includedir_SQ))
+	$(Q)$(call do_install_ld,$(TRACE_LD_FILE),$(LD_SO_CONF_DIR),$(libdir_SQ))
 
 install: install_libs
 
-- 
2.28.0


      parent reply	other threads:[~2020-11-26  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  7:27 [PATCH 0/3] libtracefs install and test fixes Tzvetomir Stoyanov (VMware)
2020-11-26  7:27 ` [PATCH 1/3] libtracefs: Add support for pkg-config Tzvetomir Stoyanov (VMware)
2020-11-26  7:27 ` [PATCH 2/3] libtracefs: Add unit tests Tzvetomir Stoyanov (VMware)
2020-11-26  7:27 ` Tzvetomir Stoyanov (VMware) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201126072719.906443-4-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).