Skip to contentSkip to conversation

libtracefs: Fix the building dependencies for make install

PATCH New Steven Rostedt 1 participant 1 message Dec 10, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Fix the building dependencies for make install

From: "Steven Rostedt (VMware)" <[email protected]>

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.

---
 Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
Makefile +12 -1
index 02b3d25..035f4de 100644
@@ -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

do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); \

Signature · 1 line
2.25.4