From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LR7sI-0003ud-1E for qemu-devel@nongnu.org; Sun, 25 Jan 2009 11:30:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LR7sG-0003uI-BC for qemu-devel@nongnu.org; Sun, 25 Jan 2009 11:30:16 -0500 Received: from [199.232.76.173] (port=50532 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR7sG-0003uF-1P for qemu-devel@nongnu.org; Sun, 25 Jan 2009 11:30:16 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:47166) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LR7sF-00040a-F4 for qemu-devel@nongnu.org; Sun, 25 Jan 2009 11:30:15 -0500 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id BDA27F970EF0 for ; Sun, 25 Jan 2009 17:30:14 +0100 (CET) Received: from [88.65.42.77] (helo=[192.168.1.198]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1LR7sE-0000xZ-00 for qemu-devel@nongnu.org; Sun, 25 Jan 2009 17:30:14 +0100 Message-ID: <497C9398.3060006@web.de> Date: Sun, 25 Jan 2009 17:30:16 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20090124151035.GA29283@miranda.arrow> <497C8AF6.8010401@web.de> <761ea48b0901250756g1613d82dr81d89707d8d3dadc@mail.gmail.com> In-Reply-To: <761ea48b0901250756g1613d82dr81d89707d8d3dadc@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Sender: jan.kiszka@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] build system: Further improve quiet mode 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 Laurent Desnogues wrote: > On Sun, Jan 25, 2009 at 4:53 PM, Jan Kiszka wrote: >> 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 f= or >>>> information such as compilation warnings, rather than extra long com= piler >>>> invocations. >>>> >>>> The full output can be generated by supplying a 'V=3D1' parameter to= make. >>> Excellent! >>> >>> However, I would find it helpful to see the name of the target that i= s >>> being built. Something like the following? ... >> Good idea! I rebased your work over recent changes and adopted it a bi= t, >> see below. Hope you still like it. :) >=20 > While you're at it, would it be possible to dump C flags once at the be= ginning > to see how things get compiled? :-) >=20 Something like this? I also included LDFLAGS - before someone asks... ------> 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. And on request by Laurent Desnogues, dump the used CFLAGS and LDFLAGS once on startup of the quiet mode. Signed-off-by: Jan Kiszka --- Makefile | 7 +++++-- rules.mak | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a09d6e0..6a7db93 100644 --- a/Makefile +++ b/Makefile @@ -34,12 +34,15 @@ ifdef CONFIG_WIN32 LIBS+=3D-lwinmm -lws2_32 -liphlpapi endif =20 -all: $(TOOLS) $(DOCS) recurse-all +all: + $(call quiet-command,$(MAKE) build-all,"Building with\n CFLAGS =3D $(= CFLAGS)\n LDFLAGS =3D $(LDFLAGS)") + +build-all: $(TOOLS) $(DOCS) recurse-all =20 SUBDIR_RULES=3D$(patsubst %,subdir-%, $(TARGET_DIRS)) =20 subdir-%: - $(MAKE) -C $(subst subdir-,,$@) V=3D"$(V)" all + $(call quiet-command,$(MAKE) -C $* V=3D"$(V)" TARGET_DIR=3D"$*/" all,) =20 $(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a diff --git a/rules.mak b/rules.mak index c4bb65b..10e21ec 100644 --- a/rules.mak +++ b/rules.mak @@ -1,19 +1,19 @@ =20 %.o: %.c - $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<," CC $= @") + $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<," CC $= (TARGET_DIR)$@") =20 %.o: %.S - $(call quiet-command,$(CC) $(CPPFLAGS) -c -o $@ $<," AS $@") + $(call quiet-command,$(CC) $(CPPFLAGS) -c -o $@ $<," AS $(TARGET_DI= R)$@") =20 %.o: %.m - $(call quiet-command,$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<," OBJC $= @") + $(call quiet-command,$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<," OBJC $= (TARGET_DIR)$@") =20 -LINK =3D $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)," LINK = $@") +LINK =3D $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)," LINK = $(TARGET_DIR)$@") =20 %$(EXESUF): %.o $(LINK) =20 %.a: - $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $@") + $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)= $@") =20 -quiet-command =3D $(if $(V),$1,@echo $2 && $1) +quiet-command =3D $(if $(V),$1,$(if $(2),@echo -e $2 && $1, @$1))