diff mbox series

libtracefs: Fix the building dependencies for make install

Message ID 20201210112423.26219821@gandalf.local.home (mailing list archive)
State Accepted
Headers show
Series libtracefs: Fix the building dependencies for make install | expand

Commit Message

Steven Rostedt Dec. 10, 2020, 4:24 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

While testing: make DESTDIR=/tmp/install/ O=/tmp/build/ install
I found that the dependencies of the install were not correct.
Add the libraries to the install path, and also fix the creation of the
directories itself.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); 	\
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 02b3d25..035f4de 100644
--- a/Makefile
+++ b/Makefile
@@ -180,7 +180,7 @@  all_cmd: $(TARGETS) $(PKG_CONFIG_FILE)
 libtracefs.a: $(LIBTRACEFS_STATIC)
 libtracefs.so: $(LIBTRACEFS_SHARED)
 
-libs:
+libs: libtracefs.a libtracefs.so
 
 test: force $(LIBTRACEFS_STATIC)
 ifneq ($(CUNIT_INSTALLED),1)
@@ -204,6 +204,17 @@  endef
 $(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template
 	$(Q) $(call do_make_pkgconfig_file,$(prefix))
 
+define do_install_mkdir
+	if [ ! -d '$(DESTDIR_SQ)$1' ]; then		\
+		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$1';	\
+	fi
+endef
+
+define do_install
+	$(call do_install_mkdir,$2);			\
+	$(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
+endef
+
 define do_install_pkgconfig_file
 	if [ -n "${pkgconfig_dir}" ]; then
					\ $(call