dependencies for sources in sub dirs.
Thu Nov 10 00:17:00 GMT 2005
Using gcc 4.0.2, I have the following problem:
Calling "gcc -MM src/foo.c" results in:
foo.o: src/foo.c src/bar.h
But IMHO that's wrong. The manpage says:
Change the target of the rule emitted by dependency
default CPP takes the name of the main input file, including any
path, deletes any file suffix such as .c, and appends the plat-
form's usual object suffix. The result is the target.
"By default CPP takes the name of the main input file, including any
So I would assume to get this:
src/foo.o: src/foo.c src/bar.h
But I don't and so the generated dependencies are useless.
Is this a bug in gcc or the manpage, or am I doing something wrong? How
can I force gcc to include the path in the target? -MT is not an option,
because I have several different subdirectories.
Hope someone knows an answer....
More information about the Gcc-help