Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH/committed] sim: touch modules target
Date: Sat, 08 May 2021 14:49:40 -0600	[thread overview]
Message-ID: <875yzt9cij.fsf@tromey.com> (raw)
In-Reply-To: <20210508163519.19783-1-vapier@gentoo.org> (Mike Frysinger via Gdb-patches's message of "Sat, 8 May 2021 12:35:19 -0400")

>>>>> "Mike" == Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> 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.

Tom

  reply	other threads:[~2021-05-08 20:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 16:35 Mike Frysinger via Gdb-patches
2021-05-08 20:49 ` Tom Tromey [this message]
2021-05-09 19:56   ` Mike Frysinger via Gdb-patches
2021-06-15  0:39   ` [PATCH] sim: switch modules.c & version.c to stamp files Mike Frysinger via Gdb-patches
2021-06-15 20:08     ` Tom Tromey
2021-06-15 21:01       ` Mike Frysinger via Gdb-patches
2021-06-15 21:07       ` [PATCH v2] " Mike Frysinger via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yzt9cij.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox