title: gcc with parameters "-S -save-temps" puts intermediate files in current directory
body: <p>The parameters <code>-S -save-temps</code> work fine, as long as i don't use them on files with the same name.</p>
  
  <p>Think of the following situation: I have a project with a main directory and a subdirectory with the name <code>subDir</code> and in both of the directories are files placed with the name <code>file.c</code>. If I now call <code>gcc -S -save-temps file.cpp subDir/file.c</code> only one intermediate file with the name <code>file.i</code> will be generated.</p>
  
  <p>That is the expected behaviour, as the man file of <code>gcc</code> tells me, that the intermediate files will always be placed in the current path, when using <code>-save-temps</code>.</p>
  
  <p>My problem is, that I'm working on projects I don't know in advance. It could very well be, that someone constructed the above mentioned example in his Makefiles. In that case I would be stuck, because I need both intermediate files.</p>
  
  <p>A few words to the system I'm constructing (for better understanding): My tool uses <code>make --just-print</code> to collect the calls, a make file of a project invokes. I scan these calls for compiler calls and add the <code>-save-temps</code> and <code>-S</code> options. The purpose is to get every preprocessed file, that is used in the process of compiling the project.</p>
  
  <p>Do you have any ideas, how I'm able to get every preprocessed file, even if the above mentioned example should appear?</p>