From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14060 invoked by alias); 8 Mar 2004 17:29:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14037 invoked from network); 8 Mar 2004 17:29:26 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 8 Mar 2004 17:29:26 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B0OZA-0005Tk-FS; Mon, 08 Mar 2004 12:29:24 -0500 Date: Fri, 19 Mar 2004 00:09:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Generate makefile dependencies Message-ID: <20040308172924.GA20940@nevyn.them.org> Mail-Followup-To: Andrew Cagney , Eli Zaretskii , gdb-patches@sources.redhat.com References: <404BBFD6.1060702@gnu.org> <6137-Mon08Mar2004080725+0200-eliz@elta.co.il> <404C9E34.4010809@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <404C9E34.4010809@gnu.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03/txt/msg00159.txt.bz2 On Mon, Mar 08, 2004 at 11:24:20AM -0500, Andrew Cagney wrote: > >>Date: Sun, 07 Mar 2004 19:35:34 -0500 > >>>From: Andrew Cagney > >>> > >>>The attached, er, hack, modifies configure.in so that all the Makefile > >>>dependencies are generated during configure time: > >>> > >>> defs_h = ... > >>> foo.o: foo.c $(defs_h) > >>> > >>>It exploits the fact that GDB's code base is very consistent in its use > >>>of "foo.h" vs -- the former is assumed to be local, the latter > >>>in a system library. > > > > > >Won't it be better to use "gcc -MM" when we compile with GCC? > > It would, except we can't assume GCC :-(. Better to always use the sed > script as that way we'll know it always (hopefully :-) works. > > It needs comments (and a doco update). So what about using the output of gcc -MM (or one of the other -M options?) to generate dependencies in the source directory, like BFD does? BTW, your comment about running automake to update deps in BFD is actually incorrect. You run 'make dep-am', which IIRC seds Makefile.am and maye regenerates Makefile.in; the dependencies aren't managed by automake. Recent versions of automake do have top-notch dependency support though. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14060 invoked by alias); 8 Mar 2004 17:29:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14037 invoked from network); 8 Mar 2004 17:29:26 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 8 Mar 2004 17:29:26 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B0OZA-0005Tk-FS; Mon, 08 Mar 2004 12:29:24 -0500 Date: Mon, 08 Mar 2004 17:29:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Generate makefile dependencies Message-ID: <20040308172924.GA20940@nevyn.them.org> Mail-Followup-To: Andrew Cagney , Eli Zaretskii , gdb-patches@sources.redhat.com References: <404BBFD6.1060702@gnu.org> <6137-Mon08Mar2004080725+0200-eliz@elta.co.il> <404C9E34.4010809@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <404C9E34.4010809@gnu.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03.o/txt/msg00159.txt Message-ID: <20040308172900.X_K0q4iKZR9Sdn_U40WmWYyIkj5AsA-hYNmJWb5Ip2I@z> On Mon, Mar 08, 2004 at 11:24:20AM -0500, Andrew Cagney wrote: > >>Date: Sun, 07 Mar 2004 19:35:34 -0500 > >>>From: Andrew Cagney > >>> > >>>The attached, er, hack, modifies configure.in so that all the Makefile > >>>dependencies are generated during configure time: > >>> > >>> defs_h = ... > >>> foo.o: foo.c $(defs_h) > >>> > >>>It exploits the fact that GDB's code base is very consistent in its use > >>>of "foo.h" vs -- the former is assumed to be local, the latter > >>>in a system library. > > > > > >Won't it be better to use "gcc -MM" when we compile with GCC? > > It would, except we can't assume GCC :-(. Better to always use the sed > script as that way we'll know it always (hopefully :-) works. > > It needs comments (and a doco update). So what about using the output of gcc -MM (or one of the other -M options?) to generate dependencies in the source directory, like BFD does? BTW, your comment about running automake to update deps in BFD is actually incorrect. You run 'make dep-am', which IIRC seds Makefile.am and maye regenerates Makefile.in; the dependencies aren't managed by automake. Recent versions of automake do have top-notch dependency support though. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer