From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id g+KmCHI+mGAIBgAAWB0awg (envelope-from ) for ; Sun, 09 May 2021 15:56:34 -0400 Received: by simark.ca (Postfix, from userid 112) id 14CF11F11C; Sun, 9 May 2021 15:56:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 528A71E783 for ; Sun, 9 May 2021 15:56:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C40913947426; Sun, 9 May 2021 19:56:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C40913947426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620590192; bh=t0D+TMZO8kH1vnkwQz9RDlUkTRe35iPv3UQlrnpQZkM=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=M7hbxwLibOOg8+jOIKLHV+fllYGrW0sMES1dPUiNj/z+6CeIp/pVyp/LS6b92AL/X 8XeLGBAVFzXl0F9MCOvflwGRxdc20wXXF2rpWXqIhjAzrpkQfc6m+Pq4Nd4QU84rN4 K3ubjFsXJU/BYTfYTn+8gcvlr00TLGAtp20XEyvw= Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 3AF11385E44A for ; Sun, 9 May 2021 19:56:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3AF11385E44A Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B2E3C335D05; Sun, 9 May 2021 19:56:28 +0000 (UTC) Date: Sun, 9 May 2021 15:56:27 -0400 To: Tom Tromey Subject: Re: [PATCH/committed] sim: touch modules target Message-ID: Mail-Followup-To: Tom Tromey , Mike Frysinger via Gdb-patches References: <20210508163519.19783-1-vapier@gentoo.org> <875yzt9cij.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <875yzt9cij.fsf@tromey.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: Mike Frysinger via Gdb-patches Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 08 May 2021 14:49, Tom Tromey wrote: > >>>>> "Mike" == Mike Frysinger via Gdb-patches writes: > > Mike> If there are no updates to the file, touch the result so we don't > Mike> keep trying to regenerate it. > > Normally you don't want to do it this way. I think it will result in > recompilations if the inputs change but the output does not. Since it > depends on Makefile and all the source files, this may be pretty often. > > Now, if that's ok with you, it's simpler to just replace the > move-if-change with a $(MV). > > The more common approach is to use a stamp file. So you write: > > modules.c: modules-c-stamp ; @true > modules-c-stamp: ... the existing code, but also touch modules-c-stamp > > There are a few examples of this idiom already in the tree. hw-config.h > uses this, in the same file. You'd also want to add the stamp file to > the clean rule. thanks, i'll take a look. i was trying trying to figure out how to use this thing correctly to avoid the rebuilds. -mike