public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/45809] New: Canonicalize file names output during dependency generation
@ 2010-09-27 12:31 konrad.schwarz at siemens dot com
  0 siblings, 0 replies; only message in thread
From: konrad.schwarz at siemens dot com @ 2010-09-27 12:31 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Canonicalize file names output during dependency
                    generation
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: konrad.schwarz@siemens.com


I have a make file responsible for files in several directories (say
main_dir, other_dir).

The files in these directories include header files using relative paths:

----other_dir/source.c
# include "../main_dir/header.h"
----

GCC, invoked with -MMD, produces dependency files of the form

----other_dir/source.d
../other_dir/source.o:\
    ../other_dir/../main_dir/header.h
----

These dependency files are included via

----Makefile
-include ../other_dir/*.d
----

If header.h is generated using a rule of the form

----Makefile
header.h: header.m4
        m4 header.m4 > header.h
----

(GNU) make fails to realize that a change to header.m4 requires a rebuild
of ../other_dir/source.o, since make uses string compares to identify targets
with prerequisites.

Pseudo-targets in Make require this sort of comparison.

Were GCC to canonicalize the file names in the dependency files it generates:

----other_dir/source.d
../other_dir/source.o:\
     header.h
----

this problem would be solved.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-27 10:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-27 12:31 [Bug preprocessor/45809] New: Canonicalize file names output during dependency generation konrad.schwarz at siemens dot com

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).