title: Why gcc "-MM" option does not generate .d output
body: <p>I tried the following code tree. If I put the header file hello.h into the "inc" archive, and use the MM option my system reported that hello.h cannot be found even I add a vpath command in my makefile. If I move the hello.h back to the same directory of hello.c, gcc -MM works fine and listed the dependence file successfully.</p>
  
  <p>How can I make the gcc know where to find the header file automatically? The following is the code tree, and "hello.h" is placed in archive "inc"</p>
  
  <pre><code>    total 12
      -rw-r--r-- 1 root root  101 Jun 22 14:13 hello.c
      drwxr-xr-x 2 root root 4096 Jun 22 14:14 inc
      -rw-r--r-- 1 root root  139 Jun 22 14:18 makefile
  </code></pre>
  
  <p>The following is my makefile content:</p>
  
  <pre><code>vpath %.h /home/tempcode/inc
  
  hello: hello.o
      gcc -o hello hello.o
  
  hello.o: hello.c hello.h
      gcc -c hello.c
  
  debug:
      gcc -MM hello.c
  </code></pre>
  
  <p>It makes me puzzled that if I run gcc directly like this, it works. does this mean VPATH or vpath do not help gcc finding the include path ? If so, I guess vpath variable only helps 'make' with finding the header file but not helping gcc, am I right?</p>
  
  <pre><code>    [root@localhost tempcode]# gcc -MM -I/home/tempcode/inc hello.c
      hello.o: hello.c /home/tempcode/inc/hello.h
  </code></pre>