From patchwork Sun Sep 16 20:08:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 29412 Received: (qmail 77506 invoked by alias); 16 Sep 2018 20:08:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 77497 invoked by uid 89); 16 Sep 2018 20:08:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=1 X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Sep 2018 20:08:52 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 99FB23096A for ; Sun, 16 Sep 2018 15:08:51 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 1dLfgo0nzBcCX1dLfgDH0n; Sun, 16 Sep 2018 15:08:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=T74M1mMq1xt6EbipY0+lP2vVOHfJEi77INg59WONX5U=; b=FHAVh0AK7v3aAA50eeFDXbQvDO y4iu4f5NS4Zgb59NT0DsValxXbH7jchlf/PoQtMI0VGhIKF2J2W99pHjIQEI8oAsq++4crbjhUGdT AfG5RJn5aZ8HcJZx0V4CqOste; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:47102 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g1dLf-00141H-CB; Sun, 16 Sep 2018 15:08:51 -0500 From: Tom Tromey To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] Sort objects in gdb and gdbserver Makefiles References: <20180916125141.6672-1-simon.marchi@polymtl.ca> <20180916125141.6672-2-simon.marchi@polymtl.ca> Date: Sun, 16 Sep 2018 14:08:50 -0600 In-Reply-To: <20180916125141.6672-2-simon.marchi@polymtl.ca> (Simon Marchi's message of "Sun, 16 Sep 2018 08:51:41 -0400") Message-ID: <87lg81nr1p.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 >>>>> "Simon" == Simon Marchi 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)