public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/28810]  New: gcc -MD -MP doesn't add phony rule for source file
@ 2006-08-22 20:21 carlton at bactrian dot org
  2006-08-22 20:29 ` [Bug preprocessor/28810] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: carlton at bactrian dot org @ 2006-08-22 20:21 UTC (permalink / raw)
  To: gcc-bugs

When I generate depends using gcc -MD -MP, it generates a dependency
for the object file on the source file and all the headers.  It also
generates an empty dependency for each header (to handle the case where
the header has gone away - that's the point of -MP).

It doesn't, however, do that for the main source file.  This behavior,
admittedly, is documentented in the manual; the manual doesn't give a reason
for this choice.

And it's causing problems for me: if I move the main source file (without
moving the corresponding object file, an admittedly rare occurrence), then
make refuses to rebuild my object file, because the dependency generated
by GCC on the old source file still exists.

If there's a reason for GCC's current behavior, then I can live with it -
I don't move a source file (without also moving the corresponding
object file!) nearly as often as I move headers.  But if there's
no particular reason, then I think the current behavior is suboptimal.

I've seen this over a range of GCC releases, including 3.2.3 and 4.1.1.


-- 
           Summary: gcc -MD -MP doesn't add phony rule for source file
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carlton at bactrian dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28810


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-08  2:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-22 20:21 [Bug preprocessor/28810] New: gcc -MD -MP doesn't add phony rule for source file carlton at bactrian dot org
2006-08-22 20:29 ` [Bug preprocessor/28810] " pinskia at gcc dot gnu dot org
2006-12-26  0:24 ` tromey at gcc dot gnu dot org
2006-12-26  3:24 ` carlton at bactrian dot org
2007-01-08  2:22 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).