Summary: Canonicalize file names output during dependency
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: preprocessor

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:

# include "../main_dir/header.h"

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


These dependency files are included via

-include ../other_dir/*.d

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

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:


this problem would be solved.

Reply via email to