From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16695 invoked by alias); 8 Mar 2004 18:06:03 -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 16680 invoked from network); 8 Mar 2004 18:06:02 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 8 Mar 2004 18:06:02 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DF5B92B92; Mon, 8 Mar 2004 13:06:01 -0500 (EST) Message-ID: <404CB609.4070609@gnu.org> Date: Fri, 19 Mar 2004 00:09:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Daniel Jacobowitz Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Generate makefile dependencies References: <404BBFD6.1060702@gnu.org> <6137-Mon08Mar2004080725+0200-eliz@elta.co.il> <404C9E34.4010809@gnu.org> <20040308172924.GA20940@nevyn.them.org> In-Reply-To: <20040308172924.GA20940@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-03/txt/msg00165.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? How is embedding this stuff in the source directory better? > 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. It appears to eventually run "gcc -MM" ... :-( Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16695 invoked by alias); 8 Mar 2004 18:06:03 -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 16680 invoked from network); 8 Mar 2004 18:06:02 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 8 Mar 2004 18:06:02 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DF5B92B92; Mon, 8 Mar 2004 13:06:01 -0500 (EST) Message-ID: <404CB609.4070609@gnu.org> Date: Mon, 08 Mar 2004 18:06:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Daniel Jacobowitz Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Generate makefile dependencies References: <404BBFD6.1060702@gnu.org> <6137-Mon08Mar2004080725+0200-eliz@elta.co.il> <404C9E34.4010809@gnu.org> <20040308172924.GA20940@nevyn.them.org> In-Reply-To: <20040308172924.GA20940@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-03.o/txt/msg00165.txt Message-ID: <20040308180600.oGYOmWu9Ty-sCqekLLHLgFRvkj2ONafpuu-Xsz3VXVo@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? How is embedding this stuff in the source directory better? > 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. It appears to eventually run "gcc -MM" ... :-( Andrew