Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nathanael Nerode <neroden@twcny.rr.com>
To: gcc-patches@gcc.gnu.org, binutils@sources.redhat.com,
	gdb-patches@sources.redhat.com, dj@redhat.com
Subject: Re: (toplevel patch) Fix multilib.out dependencies and related problems
Date: Thu, 19 Dec 2002 18:08:00 -0000	[thread overview]
Message-ID: <20021220015902.GA1721@doctormoo> (raw)

>> Uh, yeah.  Make isn't designed to realize that you can change a file
>> and not change the generated file depending on it; this is not an
>> unreasonable assumption in most cases.  To put it another way, I
>> don't care very much.
>
>Except that gcc's makefile does this all over the place, and it works
>just fine.  I was told about this trick in school - in 1986, on a
>Gould mainframe.  It works.
>
>multilib.out : gcc/xgcc
>        gcc/xgcc --print-multilibs > multilib.tmp
>        $(srcdir)/move-if-change multilib.tmp multilib.out
Right.  I'm happy to do this.

>> Of course it should.  But it can't, it actually can't, because then
>> we have a real target depending on a phony target, and every target
>> subdir gets reconfigured every single time.  Sorry.
>
>Right, except for the move-if-change trick, which short circuits it if
>there is no real change.  That's the whole purpose of the
>move-if-change script.

Hmm.  So the trick is that *multilib.out* gets hit every single time 
because it depends on all-gcc, but foo/Makefile *doesn't*.

In other words, when multilib.out is considered 'out of date' and needs 
to be rebuilt, its rule is run.  But if that rule doesn't change the 
datestamp on multilib.out, Make decides that the things depending on 
multilib.out, such as foo/Makefile, *don't* need to be rebuilt.

How sad for Make; it can't assume that because it rebuilt something, 
that that something changed. :-)  I didn't know that POSIX makes were 
required to deal with that sort of seeming paradox...

OK, I get it.  Revised patch coming in a minute or two.

--Nathanael


             reply	other threads:[~2002-12-20  2:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-19 18:08 Nathanael Nerode [this message]
2002-12-19 18:23 ` DJ Delorie
2002-12-19 18:24 ` Zack Weinberg
  -- strict thread matches above, loose matches on Subject: below --
2002-12-19 17:29 Nathanael Nerode
2002-12-19 18:00 ` DJ Delorie
2002-12-19 16:16 Nathanael Nerode
2002-12-19 17:18 ` DJ Delorie
2002-12-21 19:02   ` Alexandre Oliva

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=20021220015902.GA1721@doctormoo \
    --to=neroden@twcny.rr.com \
    --cc=binutils@sources.redhat.com \
    --cc=dj@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /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