Skip to contentSkip to conversation

libtracefs: Cleaning up the build

PATCH New Steven Rostedt 1 participant 4 messages Dec 15, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

cover libtracefs: Cleaning up the build

There are a few more clean ups for the libtracefs build system.

Steven Rostedt (VMware) (3):
libtracefs: Move do_install_* macros to utils.mk
libtracefs: Print installing messages
libtracefs: Remove KernelShark relics from build

----

 Makefile         | 19 -------------------
 scripts/utils.mk | 52 ++++++++++++++++++++++++----------------------------
 2 files changed, 24 insertions(+), 47 deletions(-)
#1 lore raw

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

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

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.

---
 Makefile         | 19 -------------------
 scripts/utils.mk | 25 ++++++++++++++-----------
 2 files changed, 14 insertions(+), 30 deletions(-)
Makefile +0 -19
index 5e7831407427..5a9d33455143 100644
@@ -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
scripts/utils.mk +14 -11
index 7967a4f290d2..71985e6a28b1 100644
@@ -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
Signature · 1 line
2.29.2
#2 lore raw

PATCH 2/3 libtracefs: Print installing messages

In reply to Steven Rostedt

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

The make install did not show anything being installed. When files are being installed, they should be printed that they are being installed.

---
 scripts/utils.mk | 1 +
 1 file changed, 1 insertion(+)
scripts/utils.mk +1 -0
index 71985e6a28b1..ad73814c5664 100644
@@ -126,6 +126,7 @@ define do_install_mkdir
 endef
 
 define do_install
+	$(print_install)				\
 	$(call do_install_mkdir,$2);			\
 	$(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
 endef
Signature · 1 line
2.29.2
#3 lore raw

PATCH 3/3 libtracefs: Remove KernelShark relics from build

In reply to Steven Rostedt

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

The utils.mk file has variables to deal with building KernelShark as it was taken from the trace-cmd.git repo. libtracefs dose not build KernelShark and we can remove the variables that were for that.

---
 scripts/utils.mk | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)
scripts/utils.mk +10 -18
index ad73814c5664..398b88a75bfb 100644
@@ -2,15 +2,7 @@
 
 # Utils
 
-ifeq ($(BUILDGUI), 1)
-  GUI		= 'GUI '
-  GSPACE	=
-else
-  GUI		=
-  GSPACE	= "    "
-endif
-
- GOBJ		= $(GSPACE)$(notdir $(strip $@))
+ GOBJ		= $(notdir $(strip $@))
 
 
 ifeq ($(VERBOSE),1)
@@ -32,15 +24,15 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1)
   print_install =
   print_update =
 else
-  print_compile =		echo '  $(GUI)COMPILE            '$(GOBJ);
-  print_app_build =		echo '  $(GUI)BUILD              '$(GOBJ);
-  print_fpic_compile =		echo '  $(GUI)COMPILE FPIC       '$(GOBJ);
-  print_shared_lib_compile =	echo '  $(GUI)COMPILE SHARED LIB '$(GOBJ);
-  print_plugin_obj_compile =	echo '  $(GUI)COMPILE PLUGIN OBJ '$(GOBJ);
-  print_plugin_build =		echo '  $(GUI)BUILD PLUGIN       '$(GOBJ);
-  print_static_lib_build =	echo '  $(GUI)BUILD STATIC LIB   '$(GOBJ);
-  print_install =		echo '  $(GUI)INSTALL     '$(GSPACE)$1'	to	$(DESTDIR_SQ)$2';
-  print_update =		echo '  $(GUI)UPDATE             '$(GOBJ);
+  print_compile =		echo '  COMPILE            '$(GOBJ);
+  print_app_build =		echo '  BUILD              '$(GOBJ);
+  print_fpic_compile =		echo '  COMPILE FPIC       '$(GOBJ);
+  print_shared_lib_compile =	echo '  COMPILE SHARED LIB '$(GOBJ);
+  print_plugin_obj_compile =	echo '  COMPILE PLUGIN OBJ '$(GOBJ);
+  print_plugin_build =		echo '  BUILD PLUGIN       '$(GOBJ);
+  print_static_lib_build =	echo '  BUILD STATIC LIB   '$(GOBJ);
+  print_install =		echo '  INSTALL     '$1'	to	$(DESTDIR_SQ)$2';
+  print_update =		echo '  UPDATE             '$(GOBJ);
 endif
 
 do_fpic_compile =					\
Signature · 1 line
2.29.2