From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LR7In-0007pn-0z for qemu-devel@nongnu.org; Sun, 25 Jan 2009 10:53:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LR7Il-0007nv-Aw for qemu-devel@nongnu.org; Sun, 25 Jan 2009 10:53:36 -0500 Received: from [199.232.76.173] (port=53274 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR7Il-0007nm-87 for qemu-devel@nongnu.org; Sun, 25 Jan 2009 10:53:35 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:49536) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LR7Ik-00062J-He for qemu-devel@nongnu.org; Sun, 25 Jan 2009 10:53:34 -0500 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate02.web.de (Postfix) with ESMTP id 51DCAF970954 for ; Sun, 25 Jan 2009 16:53:25 +0100 (CET) Received: from [88.65.42.77] (helo=[192.168.1.198]) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1LR7Ib-0002FD-00 for qemu-devel@nongnu.org; Sun, 25 Jan 2009 16:53:25 +0100 Message-ID: <497C8AF6.8010401@web.de> Date: Sun, 25 Jan 2009 16:53:26 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20090124151035.GA29283@miranda.arrow> In-Reply-To: <20090124151035.GA29283@miranda.arrow> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH] build system: Further improve quiet mode (was: Re: [6380] Make make output quieter (Avi Kivity)) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Stuart Brady wrote: > On Wed, Jan 21, 2009 at 06:13:09PM +0000, Anthony Liguori wrote: >> Spew out less noise when compiling. This helps review make output for >> information such as compilation warnings, rather than extra long compiler >> invocations. >> >> The full output can be generated by supplying a 'V=1' parameter to make. > > Excellent! > > However, I would find it helpful to see the name of the target that is > being built. Something like the following? ... Good idea! I rebased your work over recent changes and adopted it a bit, see below. Hope you still like it. :) [...] > @@ -39,7 +40,7 @@ > SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) > > subdir-%: > - $(MAKE) -C $(subst subdir-,,$@) V="$(V)" all > + $(MAKE) -C $(subst subdir-,,$@) V="$(V)" TARGET_DIR="$*" all > > $(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a > $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a > > Or is there a cleaner way of doing this? > > (BTW, could the $(subst subdir-,,$@) just be replaced with $*?) I'm no makefile guru, but from all I read this is true. So I included that cleanup as well. Jan ----------> Derived from Stuart Brady's patch: Show the target directory as prefix to the current module when building in quiet mode. This helps to gain overview of the current build progress, specifically when running parallelized builds. Furthermore, suppress make command echoing when entering subdirs and replace $(subst subdir-,,$@) with $* in the related rule. Signed-off-by: Jan Kiszka --- Makefile | 2 +- rules.mak | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a09d6e0..4f7a55a 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ all: $(TOOLS) $(DOCS) recurse-all SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) subdir-%: - $(MAKE) -C $(subst subdir-,,$@) V="$(V)" all + $(call quiet-command,$(MAKE) -C $* V="$(V)" TARGET_DIR="$*/" all,) $(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a diff --git a/rules.mak b/rules.mak index c4bb65b..a75a93b 100644 --- a/rules.mak +++ b/rules.mak @@ -1,19 +1,19 @@ %.o: %.c - $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<," CC $@") + $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") %.o: %.S - $(call quiet-command,$(CC) $(CPPFLAGS) -c -o $@ $<," AS $@") + $(call quiet-command,$(CC) $(CPPFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@") %.o: %.m - $(call quiet-command,$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<," OBJC $@") + $(call quiet-command,$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") -LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)," LINK $@") +LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)," LINK $(TARGET_DIR)$@") %$(EXESUF): %.o $(LINK) %.a: - $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $@") + $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@") -quiet-command = $(if $(V),$1,@echo $2 && $1) +quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))