From 39eee85fff1930047a7dffe11183b4cafb6eb653 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 28 Feb 2021 21:20:54 +0100 Subject: [PATCH] makefiles: better logging Show only filename instead of full path name when building in builddir != srcdir --- daemons/dmeventd/Makefile.in | 2 +- daemons/lvmlockd/Makefile.in | 2 +- libdm/dm-tools/Makefile.in | 4 ++-- libdm/make.tmpl.in | 12 ++++++------ make.tmpl.in | 12 ++++++------ man/Makefile.in | 6 ++++-- scripts/Makefile.in | 10 +++++----- tools/Makefile.in | 26 +++++++++++++------------- 8 files changed, 38 insertions(+), 36 deletions(-) diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in index 6bd36d032..99e4a816f 100644 --- a/daemons/dmeventd/Makefile.in +++ b/daemons/dmeventd/Makefile.in @@ -82,7 +82,7 @@ CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES)) endif install_include: $(srcdir)/libdevmapper-event.h - @echo " [INSTALL] $<" + @echo " [INSTALL] $($@ %.so: %.o - @echo " [CC] $<" + @echo " [CC] $( /dev/null %.d: %.c - @echo " [DEP] $<" + @echo " [DEP] $($@ %.so: %.o - @echo " [CC] $<" + @echo " [CC] $( /dev/null %.d: %.c - @echo " [DEP] $<" + @echo " [DEP] $( $@ + @echo " [TSTMAN] $@" + $(Q) - $(MANGENERATOR) --primary lvmconfig > $@ SEE_ALSO=$(srcdir)/see_also.end @@ -246,7 +247,8 @@ install_all_man: install install_systemd_generators # Copy generated man pages back to source tree as fallback for machines where generator doesn't work pregenerated_man: all - set -e ; for i in $(srcdir)/*.8_des; do \ + @echo " [GENERATE] $^" + $(Q) set -e ; for i in $(srcdir)/*.8_des; do \ CMD=`basename $$i .8_des`; \ cat $${CMD}.8_gen > $(srcdir)/$$CMD.8_pregen ; \ done diff --git a/scripts/Makefile.in b/scripts/Makefile.in index e3843977e..e8f674282 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -59,7 +59,7 @@ install: install_lvm2 install_ocf install_device-mapper # FIXME Customise for other distributions install_initscripts: - @echo " [INSTALL] $<" + @echo " [INSTALL] initscripts" $(Q) $(INSTALL_DIR) $(initdir) ifeq ("@BUILD_DMEVENTD@", "yes") $(Q) $(INSTALL_SCRIPT) lvm2_monitoring_init_red_hat $(initdir)/lvm2-monitor @@ -81,12 +81,12 @@ lvm2_activation_generator_systemd_red_hat: $(OBJECTS) $(LVMINTERNAL_LIBS) $(Q) $(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) $(LVMINTERNAL_LIBS) $(LIBS) install_systemd_generators: - @echo " [INSTALL] $<" + @echo " [INSTALL] systemd_generators" $(Q) $(INSTALL_DIR) $(systemd_generator_dir) $(Q) $(INSTALL_PROGRAM) lvm2_activation_generator_systemd_red_hat $(systemd_generator_dir)/lvm2-activation-generator install_systemd_units: install_dbus_service - @echo " [INSTALL] $<" + @echo " [INSTALL] systemd_units" $(Q) $(INSTALL_DIR) $(systemd_unit_dir) $(Q) $(INSTALL_DATA) lvm2-pvscan.service $(systemd_unit_dir)/lvm2-pvscan@.service ifeq ("@BUILD_DMEVENTD@", "yes") @@ -114,7 +114,7 @@ endif ifeq ("@BUILD_LVMDBUSD@", "yes") install_dbus_service: - @echo " [INSTALL] $<" + @echo " [INSTALL] dbus_service" $(Q) $(INSTALL_DIR) $(dbusconfdir) $(Q) $(INSTALL_DIR) $(dbusservicedir) $(Q) $(INSTALL_DATA) $(top_srcdir)/scripts/com.redhat.lvmdbus1.conf $(dbusconfdir) @@ -124,7 +124,7 @@ install_systemd_units: install_dbus_service endif install_tmpfiles_configuration: - @echo " [INSTALL] $<" + @echo " [INSTALL] configuration" $(Q) $(INSTALL_DIR) $(tmpfiles_dir) $(Q) $(INSTALL_DATA) lvm2_tmpfiles_red_hat.conf $(tmpfiles_dir)/lvm2.conf diff --git a/tools/Makefile.in b/tools/Makefile.in index c89c75fa5..a099973e1 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -155,16 +155,16 @@ liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS) @echo " [CC] $@" $(Q) $(CC) -shared -Wl,-soname,$@.$(LIB_VERSION) \ $(CFLAGS) $(CLDFLAGS) -o $@ \ - @CLDWHOLEARCHIVE@ liblvm2cmd.a @CLDNOWHOLEARCHIVE@ \ + @CLDWHOLEARCHIVE@ $< @CLDNOWHOLEARCHIVE@ \ $(LVMINTERNAL_LIBS) $(LVMLIBS) liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX) @echo " [LN] $@" $(Q) $(LN_S) -f $< $@ -.commands: $(srcdir)/commands.h $(srcdir)/cmdnames.h Makefile - @echo " [CC] $<" - $(Q) $(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \ +.commands: $(srcdir)/cmdnames.h $(srcdir)/commands.h Makefile + @echo " [CC] $( /dev/null | \ $(EGREP) -v '^ *(|#.*|config|devtypes|dumpconfig|formats|fullreport|help|lastlog|lvmchange|lvpoll|pvdata|segtypes|systemid|tags|version) *$$' > .commands command-count.h: $(srcdir)/command-lines.in Makefile @@ -173,13 +173,13 @@ command-count.h: $(srcdir)/command-lines.in Makefile ( cat $(top_srcdir)/tools/license.inc && \ echo "/* Do not edit. This file is generated by the Makefile. */" && \ echo -n "#define COMMAND_COUNT " && \ - $(GREP) '^ID:' $(srcdir)/command-lines.in | $(WC) -l \ + $(GREP) '^ID:' $< | $(WC) -l \ ) > $@ cmds.h: $(srcdir)/command-lines.in Makefile @echo " [GEN] $@" $(Q) set -o pipefail && \ - ( cat $(top_srcdir)/tools/license.inc && \ + ( cat $(srcdir)/license.inc && \ echo "/* Do not edit. This file is generated by the Makefile. */" && \ echo "cmd(CMD_NONE, none)" && \ $(GREP) '^ID:' $(srcdir)/command-lines.in | LANG=C $(SORT) -u | $(AWK) '{print "cmd(" $$2 "_CMD, " $$2 ")"}' && \ @@ -189,7 +189,7 @@ cmds.h: $(srcdir)/command-lines.in Makefile command-lines-input.h: $(srcdir)/command-lines.in Makefile @echo " [GEN] $@" $(Q) set -o pipefail && \ - ( cat $(top_srcdir)/tools/license.inc && \ + ( cat $(srcdir)/license.inc && \ echo "/* Do not edit. This file is generated by the Makefile. */" && \ echo -en "const char _command_input[] =\n\n\"" && \ $(EGREP) -v '^#|\-\-\-|^$$' $(srcdir)/command-lines.in | $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \ @@ -208,7 +208,7 @@ endif install_tools_dynamic install_tools_static install_cmdlib_include: $(srcdir)/lvm2cmd.h - @echo " [INSTALL] $<" + @echo " [INSTALL] $(