diff mbox series

[1/3] libtracefs: Move do_install_* macros to utils.mk

Message ID 20201215164107.465848331@goodmis.org (mailing list archive)
State Accepted
Commit a8f2e3582a3bdc50782d1128806f25c0601fd31a
Headers show
Series libtracefs: Cleaning up the build | expand

Commit Message

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

The do_install_* macros are in the main Makefile, and they overwrite some of
the same macros in utils.mk. Move those macros into the utils.mk and delete
the ones that were not used.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile         | 19 -------------------
 scripts/utils.mk | 25 ++++++++++++++-----------
 2 files changed, 14 insertions(+), 30 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 5e7831407427..5a9d33455143 100644
--- a/Makefile
+++ b/Makefile
@@ -206,25 +206,6 @@  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); 	\
-	else 									\
-		(echo Failed to locate pkg-config directory) 1>&2;		\
-	fi
-endef
-
 tags:	force
 	$(RM) tags
 	$(call find_tag_files) | xargs ctags --extra=+f --c-kinds=+px
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 7967a4f290d2..71985e6a28b1 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -119,18 +119,21 @@  define update_dir
 	fi);
 endef
 
+define do_install_mkdir
+	if [ ! -d '$(DESTDIR_SQ)$1' ]; then		\
+		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$1';	\
+	fi
+endef
+
 define do_install
-	$(print_install)				\
-	if [ ! -d '$(DESTDIR_SQ)$2' ]; then		\
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2';	\
-	fi;						\
-	$(INSTALL) $1 '$(DESTDIR_SQ)$2'
+	$(call do_install_mkdir,$2);			\
+	$(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
 endef
 
-define do_install_data
-	$(print_install)				\
-	if [ ! -d '$(DESTDIR_SQ)$2' ]; then		\
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2';	\
-	fi;						\
-	$(INSTALL) -m 644 $1 '$(DESTDIR_SQ)$2'
+define do_install_pkgconfig_file
+	if [ -n "${pkgconfig_dir}" ]; then 					\
+		$(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); 	\
+	else 									\
+		(echo Failed to locate pkg-config directory) 1>&2;		\
+	fi
 endef