public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Sort objects in gdb and gdbserver Makefiles
Date: Sun, 16 Sep 2018 20:08:00 -0000	[thread overview]
Message-ID: <87lg81nr1p.fsf@tromey.com> (raw)
In-Reply-To: <20180916125141.6672-2-simon.marchi@polymtl.ca> (Simon Marchi's	message of "Sun, 16 Sep 2018 08:51:41 -0400")

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> Tom mentioned this a while ago, as a way to give you a cheap sense of
Simon> progression in your build, as all object files will be built
Simon> alphabetically (including the directory part).

Try this for fun.

Tom

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index d49f3eef446..366abba69fe 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1894,11 +1894,27 @@ libgdb.a: $(LIBGDB_OBS)
 	$(AR) q libgdb.a $(LIBGDB_OBS)
 	$(RANLIB) libgdb.a
 
+ALL_GDB_OBS = gdb.o $(LIBGDB_OBS)
+
+# Usage: set-object-index LIST
+# Where LIST is a list WORD1...WORDN
+# Define $(WORDN)-index to an integer and then recurse on the
+# remaining words.
+define set-object-index =
+$(if $(1),
+  $(lastword $(1))-index := $(words $(1))
+  $(call set-object-index,$(wordlist 1,$(words $(wordlist 2,100000,$(1))),$(1))))
+endef
+
+$(eval $(call set-object-index,$(ALL_GDB_OBS)))
+
+override ECHO_CXX = @echo "[$($@-index) / $(words $(ALL_GDB_OBS))]  CXX    $@  ";
+
 # Removing the old gdb first works better if it is running, at least on SunOS.
-gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(CDEPS) $(TDEPLIBS)
+gdb$(EXEEXT): $(ALL_GDB_OBS) $(CDEPS) $(TDEPLIBS)
 	$(SILENCE) rm -f gdb$(EXEEXT)
 	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
-		-o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
+		-o gdb$(EXEEXT) $(ALL_GDB_OBS) \
 		$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
 ifneq ($(CODESIGN_CERT),)
 	$(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT)

  parent reply	other threads:[~2018-09-16 20:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-16 12:51 [PATCH 1/2] gdbserver/Makefile.in: Remove ADD_DEPS Simon Marchi
2018-09-16 12:51 ` [PATCH 2/2] Sort objects in gdb and gdbserver Makefiles Simon Marchi
2018-09-16 14:12   ` Tom Tromey
2018-09-16 20:08   ` Tom Tromey [this message]
2018-09-17  0:40     ` Simon Marchi
2018-09-17  3:46       ` Tom Tromey
2018-09-16 14:10 ` [PATCH 1/2] gdbserver/Makefile.in: Remove ADD_DEPS Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lg81nr1p.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).