title: Compile multiple C source fles into a unique object file
body: <p>I have some C source files and I am using <code>gcc</code>. I basically want to compile all of them and create one single object file. When I try:</p>
  
  <pre><code>gcc -c src1.c src2.c src3.c -o final.o
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>gcc: cannot specify -o with -c or -S with multiple files
  </code></pre>
  
  <p>If I try:</p>
  
  <pre><code>gcc -c src1.c src2.c src3.c
  </code></pre>
  
  <p>I get three different object files. How can I tell <code>gcc</code> to compile all files to return one single object file (I also want to specify its name)? Thank you.</p>
  
  <p>Maybe there is another more common approach to this, in this case please tell me.</p>