From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5908 invoked by alias); 14 Jan 2014 01:18:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5895 invoked by uid 89); 14 Jan 2014 01:18:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-pb0-f46.google.com Received: from mail-pb0-f46.google.com (HELO mail-pb0-f46.google.com) (209.85.160.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 14 Jan 2014 01:18:30 +0000 Received: by mail-pb0-f46.google.com with SMTP id ma3so2531272pbc.19 for ; Mon, 13 Jan 2014 17:18:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=QPomgLXUTxlcMkkj1dBXymb3PjPxqMZG1YMbApGFtdo=; b=Gup4XRcmHz3hAJxTi4cB2GB4PDy69KenxIT4/Y8UUz76PRaGbZ9DeV0dZJV9/eFGAK L9QDm4R76YXh1HJ82BdlyX0wUw8nr6KZbVjrEeiJsL/BU2oXw/UOv2AzoPzi2ZPl0gho /1lAURKXNHIActSs69nBv2zxuA/Q5gN/m4lvQU9PUxA0oP1sLictasDKwD9CtUqXpt6Q kbMHeqLfx/1hufHLAkezp60x48Lotn5PgNHGc/e0t56yK4b7Z8YV1e3BXJh9tGteoTTK S7dLbms099WDo2sh+LXGPnkcDqWr4ppRGhL210qJVEu9bSSXx7suZx4WtCFy6BqHdm9+ HZmw== X-Gm-Message-State: ALoCoQnBfHwT+giOdnj1nGm+ptDPZPWw7V0R+1P6L+aKA66LMYPaLT9zgQY1KiyXXABR3HZLVoD4 MIME-Version: 1.0 X-Received: by 10.66.227.4 with SMTP id rw4mr33317939pac.128.1389662308436; Mon, 13 Jan 2014 17:18:28 -0800 (PST) Received: by 10.70.38.232 with HTTP; Mon, 13 Jan 2014 17:18:28 -0800 (PST) In-Reply-To: <871u0b3btt.fsf@fleche.redhat.com> References: <1389563743-29311-1-git-send-email-patrick@parcs.ath.cx> <871u0b3btt.fsf@fleche.redhat.com> Date: Tue, 14 Jan 2014 01:18:00 -0000 Message-ID: Subject: Re: [PATCH] gdb: replace suffix rules with pattern rules From: Patrick Palka To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-01/txt/msg00387.txt.bz2 On Mon, Jan 13, 2014 at 2:45 PM, Tom Tromey wrote: >>>>>> "Patrick" == Patrick Palka writes: > > Patrick> Suffix rules (e.g. .c.o:) are error-prone and may not interact > Patrick> well with GNU make's -r/--no-builtin-rules flag. Replace them > Patrick> with otherwise-equivalent pattern rules (e.g. %.o: %.c). > > Despite appearances, gdb's use of GNU make features is constrained to > parallel check and, if GNU make is available, dependency tracking. That > is, in theory you can do a "one-off" build of gdb using some other make. I see. That explains why e.g. static pattern rules are not used either. > I wouldn't mind requiring GNU make -- gcc has done it for years without > adverse effects -- but it isn't currently the case. > > TBH I am not sure how you'd go about getting this sort of change > approved. > > Patrick> As a result of this change, one can now successfully build gdb/ with > Patrick> make's -r flag which improves build time by a bit. > > There's a zillion other directories to cope with in the tree. > Does make -r work in all of them except gdb? > If so, how? Not all. The directories whose makefiles are generated by automake work under make -r and so do the ones that don't use suffix rules at all. The ones generated by automake work because automake makes sure to explicitly populate the .SUFFIXES target with the relevant file extensions. The gdb/ makefile doesn't work under make -r essentially because it relies on a ".c.o:" suffix rule but the file extensions .c and .o are not in .SUFFIXES. (So, a portable variant of the above patch would be to make sure to add .c and .o into the .SUFFIXES target, leaving the suffix rules in place.) Likewise for one or two other makefiles in the tree, suchas the one under readline/. I was not aware of the concern about portability. I'll repost a portable version of the patch once I submit my copyright assignment.